Results 1 to 3 of 3
How can I read file line by line
I wont to read all lines and do same command to each line
for example if I have directory's paths like
./Load_spcl_cldspn_trn3_Jun_09_2007_153838.ch_log
...
- 08-15-2007 #1Just Joined!
- Join Date
- Jul 2007
- Posts
- 31
How can I read file line by line
How can I read file line by line
I wont to read all lines and do same command to each line
for example if I have directory's paths like
./Load_spcl_cldspn_trn3_Jun_09_2007_153838.ch_log
./Load_spcl_cldspn_trn4_Jun_09_2007_153939.ch_log
./Load_spcl_cldspn_trn5_Jun_10_2007_071734.log
./Load_spcl_cldspn_trn4_Jun_09_2007_160253.ch_log
./Load_spcl_cldspn_trn3_Jun_10_2007_072059.log
./Load_spcl_cldspn_trn4_Jun_10_2007_072317.log
./Load_spcl_cldspn_trn6_Jun_10_2007_072717.log
and I wont to do this command
ls -tg
- 08-15-2007 #2
Maybe something like
Code:$for i in `ls -tg`;do somecommand "i";done
- 08-15-2007 #3
From the command line you can use:
Code:ls <file name> | xargs <command for each line> or xargs -a <file name> <command for each line>


Reply With Quote