10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am a bit confused ,why would a sed command work fine outside of ksh script but not inside.
I want to replace all the characters which end with a value and have space at end of it.
so my command for it is :
sed -i "s/$SEPARATOR /$SEPARATOR/g" file_name
This is working fine in... (8 Replies)
Discussion started by: vital_parsley
2. Shell Programming and Scripting
What am I doing wrong here?
$ cat test_sed.ksh
var="sed -e \'6s/9/6/\' testfile.txt > testfile.txt.2"
sed: command garbled: \'6s/9/6/\'
Thank you! (4 Replies)
Discussion started by: ejianu
3. Shell Programming and Scripting
I'm trying to do an ls from inside of a ksh script. I loop through the results one line at a time and attempt to do a substitution using sed to convert YYYYMMDD from the older files into the newer files. Basically sometimes the ETL load runs over midnight and half the files are off by one day... (3 Replies)
Discussion started by: Calbrenar
4. Shell Programming and Scripting
I am using SED to edit a file (called file)
the file contains the word "ERROR"
and I want to use SED to:
1. Search for text "ERROR"
2. Append new line with text "hoi"
sed 's/ERROR/ a\hoi' file
sed 's/ERROR/ a\ hoi' file
I get all the time the error
sed:... (7 Replies)
Discussion started by: Alex400
5. Shell Programming and Scripting
I am working with a korn shell script. I should replace in a very great file the character ";" with a space.
what the fastest method is? Sed? Awk?
Speed is dead main point, Seen the dimensions of the files
Thanks (6 Replies)
Discussion started by: GERMANICO
6. Shell Programming and Scripting
I have the following issue while replacing text in a file usind sed
$ cat file
$ One,ABCD\XYZ,Server one
i want to replace ABCD\XYZ with another text SERVER. with ABCD\XYZ stored in a variable.
cat file | sed 's/'"$VAR"'/SERVER/'
... (14 Replies)
Discussion started by: sudheer1984
7. Shell Programming and Scripting
Okay, title is kind of confusion, but basically, I have a lot of scripts on a server that I need to replace a ps command, however, the new ps command I'm trying to replace the current one with pipes to sed at one point. So now I am attempting to create another script that replaces that line.
... (1 Reply)
Discussion started by: cbo0485
8. Shell Programming and Scripting
Hi, i need help passing variables to sed using ksh.
My goal is to get particular data from log files.
first i put a mark to the log files.
echo "TEST_"`date + %m_%d_%Y_%T"` >markFile
this will produce a 'markFile' which contain text like this
then i put the mark... (2 Replies)
Discussion started by: d.anggrianto
9. Shell Programming and Scripting
Sorry for the duplicate thread this one is similar to the one in
Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
Discussion started by: rajan_san
10. Shell Programming and Scripting
i am trying to append a 5 line SGML file(file1) with a 500,000 line SGML file (file2).
file1 is a template, so i wish to preserve.
i only want to add lines 5 to the end of file2.
cp file1 temp1
sed -n '5,$p' file2 >> temp1
when i check the tail of temp1, i consistantly find the... (3 Replies)
Discussion started by: smac