I rectified the shabang line.
But the change is not reflected in the passwd file.
It won't - sed does not work like that. If you are using a Linux system you can use the -i or --in-place option, ie
If you are not using Linux, and the sed you have is not a gnu sed try this instead:
While you could just rename passwd into passwd-old and then redirect the output of sed directly into a new passwd file this should help you back out if there are problems with the script.
I have a 'sed' editor command trying to read contents of one file into another.
v=t1
PX=25
sed '/for/ r /$v/ext/tsfirmfiles.${PX}' /bb/bin/px${PX}.files.2b.deleted > result
I cannot come up with the syntax so 'sed' would do a variable substitution.
Any idea? Thanks a for help. -A (1 Reply)
Hello,
i have another sed question.. I'm trying to do variable substition with sed and i'm running into a problem.
my var1 is a string constructed like this:
filename1 filerev1 filepath1
my var2 is another string constructed like this:
filename2 filerev2 filepath2
when i do... (2 Replies)
Hi,
I am facing a strange problem. I have a script that used the following to search and replace text:
sed 's/'"${find_var_parm}"'/'"${find_var_filter}"'/g' $ParmFile > $TempFile
The values of $find_var_parm and $find_var_filter are set based on search criteria. The above seems to be working... (2 Replies)
Hi Chaps...
I have a log file as below:-
01 Oct 2009 12:57:56 DEBUG :
01 Oct 2009 12:14:21 DEBUG :.....
.
.
.
.05 Oct 2009 14:31:56 DEBUG :....
.
.
.05 Oct 2009 12:57:56 DEBUG :....
06 Oct 2009 01:23:11 DEBUG :....
.
.
.06 Oct 2009 12:53:46 DEBUG :.... (4 Replies)
Hi,
I have to insert a line at a particular line number in my file. But the line number is not fixed and it will vary every time. So, I have to use a variable to get the line number
I know we can use sed to insert lines at a particular line number but it does not work with variable... (3 Replies)
Give the code:
set line = 2
set year = `sed -n '2p' file
while ($line < 500)
echo $line > f.txt
@ line = $line + 1
end
How do I utilize the variable $line in the code instead of the number 2. I'm using this in a while loop and counter. I've tried quoting it, double/single... (1 Reply)
Hello, I searched the forum and unable to find a solution for my particular problem. I have a text file I'm trying to insert some text using sed after finding a pattern..
File contains in one line
Invoice date: xx/xx/xxxx Balance: $$$$ Name: xxxxxxxxxxxxxx
Trying to insert Invoice "Number:... (3 Replies)
Hi I am trying to do the following in a script find a string and add in a block of text two lines above on the command line this works fine
#/usr/bin/cat /usr/local/etc/dhcpd.conf_subnet | /usr/xpg4/bin/sed -n -e '1h;1\!H;${;g;s/}.*#END of 10.42.33.0/#START of RANGE $dstart\:option... (3 Replies)