Sample Header Ad - 728x90

I want to check the output of multiple files by typing a single command

0 votes
1 answer
165 views
(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) What the above does is that a simulation is running (what that is is not important) and the above command tracks it, by printing out the files in the directory: - ..../forward_src01_ls01/out_data_forward - ..../forward_src01_ls02/out_data_forward - ..../forward_src01_ls03/out_data_forward - ..../forward_src01_ls04/out_data_forward and so on till src_08. It runs in some linux systems without error. But in my system, it throws the below error: [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 To be clear, these files do exist... I can open them individually, but not in a batch.
Asked by Prasad Mani (103 rep)
Nov 3, 2018, 02:34 PM
Last activity: Nov 3, 2018, 04:44 PM