hi all,
i have trackfile.txt which contains the data as
0 /home8/mc09ats/UnixCw/t1
1 /home8/mc09ats/UnixCw/t2
2 /home8/mc09ats/UnixCw/t3
3 /home8/mc09ats/UnixCw/t4
if user says delete 1 then i want to delete 1 /home8/mc09ats/UnixCw/t2
line from file...there is space between all numbers and "/".
how i can do that?
line=`grep "$Index_Line" $HOME/UnixCw/backup/trackfile.txt`
sed -i "/$line/d" $HOME/UnixCw/backup/trackfile.txt
>$HOME/UnixCw/backup/trackfile2.txt
mv $HOME/UnixCw/backup/trackfile2.txt $HOME/UnixCw/backup/trackfile.txt
its not working....
first, tell us how its not working. you don't have output? or you have output but it doesn't change? or what?
also why are you using the -i option of sed, when you are creating temp files and renaming it back ?