Search Results

Search: Posts Made By: sathishkmrv
12,087
Posted By agama
Rather than moving the file, cat the tmp file...
Rather than moving the file, cat the tmp file back onto the original file:


sed 's/foo/bar/' <ofile >tfile
cat tfile >ofile
12,087
Posted By alister
Use ed: printf '1,90d\nw\nq\n' | ed -s test.bak...
Use ed:
printf '1,90d\nw\nq\n' | ed -s test.bak
... or, alternatively, with a heredoc ...
ed -s test.bak <<EOED
1,90d
w
q
EOED

Example:
$ jot 100 > data
$ ls -i data
5490111 data
$ wc...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 10:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy