Suppose I have a bunch of files, the names of which contain a number, like this: xxx_1.txt, xxx_2.txt, ... xxx_42.txt
In bash, it's easy to operate on subsets of these files, e.g. ls xxx_{1..33}.txt xxx_{35..41}.
What would be the tcsh analog of this?
As far as I know there is no built-in mechanism to specify range patterns (except single character ranges) in tcsh. But you could, for example, use the seq utility (if it is available) together with sed:
ls `(seq 1 33; seq 35 41)|sed 's/^/xxx_/;s/$/.txt/'`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With