replace line with sed in csh
Posted
by not_a_geek
on Stack Overflow
See other posts from Stack Overflow
or by not_a_geek
Published on 2010-05-07T11:15:39Z
Indexed on
2010/05/07
11:18 UTC
Read the original article
Hit count: 328
Hello,
I am trying to change the content of a specific line in a batch of files. I thought that would be a piece of cake but for some reason, nothing happens, so I guess I am missing something. Line 8 should have been replaced.
Here the csh script I used:
!/bin/csh
#
replace context in line xxx by yyy
2010/05/07
set files = ls FILENAMEPART*
echo $files
foreach file ($files)
sed '8,8 s/1/2 /' $file
end
thanks for suggestions
© Stack Overflow or respective owner