tcsh-org / tcsh

This is a read-only mirror of the tcsh code repository.
https://www.tcsh.org/
Other
232 stars 42 forks source link

(wish): better nonomatch #10

Closed ghost closed 5 years ago

ghost commented 5 years ago

set nonomatch set list = ( *.txt )

echo $#list $list prints 1 *.txt

it should prints just 0

so you can check if the list is empty

suominen commented 5 years ago

If list has the word *.txt in it then the number of words in list is 1.

You are looking to do something like this:

ls -1d *.txt | wc -l