The Text File is cd.txt contains in an order till.cdt.
-r--r--r-- 3 admin admin 10485558 Jun 13 15:26 /data01/cur/000000000000000A.cdt
-r--r--r-- 3 admin admin 10485250 Jun 13 15:30 /data01/cur/0000000000000011.cdt
-r--r--r-- 3 admin admin 10484680 Jun 13 15:33 /data01/cur/0000000000000020.cdt
-r--r--r-- 3 admin admin 10485640 Jun 13 15:36 /data01/cur/000000000000002F.cdt
-r--r--r-- 3 admin admin 10485372 Jun 13 15:41 /data01/cur/000000000000003E.cdt
i want to print each line and then assign 5th column to a variable.
i tried echoing the line and getting the 5th column ... it doesnt work giving the below output.
code i used:
while read line
do
t=$(echo "$line" | awk '{print $5}')
echo t
done < <(~/hlw/fcdt.txt)
output :
admin@hpdl365g1-2:~/hlw$./find_badhashes.sh
/
home/admin/hlw/fcdt.txt: line 1: -r--r--r--: command not found
/home/admin/hlw/fcdt.txt: line 2: -r--r--r--: command not found
/home/admin/hlw/fcdt.txt: line 3: -r--r--r--: command not found
how to get the task done? please let me know .
thanks