Thanks it works But it's right that if the line 13 doesn't exist its not working
Yes, because it works as designed:
means: go to line 13 and apply the following substitution (s/...) to this line. So, yes, it works on line 13 and nothing else.
If you want to employ a logic like search for a certain line and add some new line after that it is a little more complicated: you need the "n" command (read next line into pattern space). The following example uses GNU-sed:
Every line beginning with with "ABC" will get a new line after it containing "new text". The only problem here (in order to keep the example simple) is that this would not work properly if the last line of a file would be "ABC".
Running a installation on Solaris 11 and getting error write to 1 failed
If anyone can advise ?
ORIGINAL_PATH="${PATH}"
# prepend /usr/xpg4/bin to PATH as needed
temporaryPath=`expr "${PATH}:" : '\(/usr/xpg4/bin:\)'`
if
then
PATH="/usr/xpg4/bin:${PATH}"
seem to have... (6 Replies)
Hi ,
In file first line start with "",when trying to remove using sed i am getting the below error .Please advise
sed -e 's///g' -e 's/$]//g' segment1.txt >>segment_m1
sed: couldn't write 1378 items to stdout: No space left on device
Thanks,
Mohan (1 Reply)
I am getting error in a shell script having a simple date command.
Error is " write to 1 failed ".
We saw that /tmp folder was 100% full. When we cleared some space in /tmp folder then script worked fine. Why does date command(or any other command) require space in /tmp folder? Which settings... (6 Replies)
I am a scripting noob, and having much trouble getting this script to run correctly. Upon start it should read the home directory and sort the files into a text file. Then have user enter a user name and insert it into line 1 of the same text file. Then have the date insert into the second line of... (8 Replies)
Hi All,
This is Sandeep Gupta,
I am facing a problem with sudo command.
Whenever i am executing the command "visudo" i am getting the error "visudo: write error: No space left on device".
but i have checked on my Solaris Box everything is ok, i have enough free space on my box, and also... (13 Replies)
Hello all. I need a simple way to write to a specific memory space (/dev/mem). In a bash script if possible. (I am using dd to read the changes) Thanks in advace. (4 Replies)
Hello all. I need a simple way to write to a specific memory space (/dev/mem). In a bash script if possible. (I am using dd to read the changes) Thanks in advace. (0 Replies)
hi
iam facing problem regarding sed function. give me reply
with example of sed function. and what to meanings of $# and @
in scripting
please as reply as soon as possible (1 Reply)
I am trying to create new files under my directory...but i getting the following message...
cat: write error: No space left on device
How do we handle this error.
I am not getting this error when I login as the super user (3 Replies)
This is likely to be a dumb one.
How can I use sed to substitute string occurances having it read from an input file and write to this very same file ?
I have a file with lots of occurances of '2006', I want to change it to '2007', but I'd like these changes to be saved on the input file.
... (5 Replies)