file_cnt=`cat abc_ | wc -l`
head -$file_cnt abc > abc_2
if [ "$?" != "0" ]; then
error "failed on rename abc_ > abc_2"
exit 1
fi
try_run "rm -f abc_"
try_run "mv abc_2 abc_"
This is what the output on screen, I get on executing---->
+ + wc -l
+ cat abc_
file_cnt= 236
+ head - 236 abc_
-: No such file or directory
236: No such file or directory
+ [ 1 != 0 ]
+ error failed on rename abc_ > abc_2
+ exit 1
I aint able to understand why i get the space between the dash and 236
head - 236 abc_
Now please let me tell you why I need to do this....
This is what is happening......
dev$ wc -l abc_
236 abc_
dev$ head -236 abc_ > abc_2
dev$ wc -l abc_2
229 abc_2
dev$
have no clue on why this is happening.....
---------- Post updated at 02:55 AM ---------- Previous update was at 02:53 AM ----------
Sure Tony.. Thanks a lot...
i just post the reason why i need to do this... if you can please take a look on it.. and suggest me ?