[英]numeric range in tcsh
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假设我有一堆文件,其名称包含一个数字,像这样:xxx_1.txt, xxx_2.txt, ... xxx_42.txt
In bash, it's easy to operate on subsets of these files, eg ls xxx_{1..33}.txt xxx_{35..41}
.在 bash 中,很容易对这些文件的子集进行操作,例如
ls xxx_{1..33}.txt xxx_{35..41}
。
What would be the tcsh analog of this? tcsh 的类似物是什么?
As far as I know there is no built-in mechanism to specify range patterns (except single character ranges) in tcsh
.据我所知,在
tcsh
中没有指定范围模式(单个字符范围除外)的内置机制。 But you could, for example, use the seq
utility (if it is available) together with sed
:但是,例如,您可以将
seq
实用程序(如果可用)与sed
一起使用:
ls `(seq 1 33; seq 35 41)|sed 's/^/xxx_/;s/$/.txt/'`
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.