(directory=$(python -c 'import read_params; print(read_params.get_directory())')
nsrc=$(cat $directory/master.pixels|wc -l)
tail $directory/forward_src0{1..$nsrc}_ls00/out_data_forward)上面所做的是模拟正在运行(这并不重要),上面的命令通过打印目录中的文件来跟踪它:
等等,直到src_08。
它在一些linux系统中运行,没有错误。但是在我的系统中,它会抛出以下错误:
[prasad@daahpc1 sparc_flows]$ (directory=$(python -c 'import read_params; print(read_params.get_directory())')
> nsrc=$(cat $directory/master.pixels|wc -l)
> tail $directory/forward_src0{1..$nsrc}_ls00/out_data_forward)
tail: cannot open /scratch/prasad/sparc_test/forward_src0{1..8}_ls00/out_data_forward' for reading: No such file or directory说清楚,这些文件确实存在..。我可以单独打开,但不能成批打开。
发布于 2018-11-03 14:40:29
您的系统中的shell似乎与您在其他系统上使用的shell不同(echo $SHELL)
本地shell不理解/替换{1..8}调用的tail。
尝试在您的系统上使用相同的shell,也可以在脚本中使用*通用通配符,以防{1..8}可以安全地被*替换。
https://unix.stackexchange.com/questions/479593
复制相似问题