milink
1
Hi,
I want to display list of last 10 backup files (with numbering) from the temporary file
c:/tmp/tmp_list_bkp.txt
Example :
1) backup_file1
2) backup_file2
3) backup_file3
........
........
I tried as below but not working.
for file in c:/tmp/tmp_list_bkp.txt
do
echo $file
echo ""
done
How this can be done using shell script ?
With Regards
Your script did not work because the file tmp_list_bkp.txt was not been opened.
try replacing as below..
for file in $(cat c:/tmp/tmp_list_bkp.txt)
To list the only last 10 files from the file
for file in $(tail c:/tmp/tmp_list_bkp.txt)
how about:
cat -n c:/tmp/tmp_list_bkp.txt
or
nl c:/tmp/tmp_list_bkp.txt
milink
4
Hi,
Issue solved, got the required output.
With Regards