10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
My variable contains the following string
I wish to replace \n with "space" so the expected output is:
I understand that the /n is not a new linein this case.
I'm on AIX using ksh shell. Below is all that I tried.
echo $str | sed -e "s#\n# #g";
echo $str | sed -e "s#\n#' '#g";... (5 Replies)
Discussion started by: mohtashims
5 Replies
2. Shell Programming and Scripting
I have a simple task to replace unix line feed end of line characters with carriage returns.
When I run the following “change file in place” sed instruction from the command line all the Line feeds are successfully replaced with Carriage returns.
sed -i 's/$/\r/' lf_file.txt
But that same... (1 Reply)
Discussion started by: hawkman2k
1 Replies
3. Shell Programming and Scripting
Hi
1st problem
--------------
i have this sed command in my unix script which replaces new line and carriage return in a line with the string "
"
the script works fine in Linux 3.0.101-0.5, but not in AIX 1 7 , the "s/\r/\
/g" replacement, replaces
all the character "r" in the file.... (3 Replies)
Discussion started by: maximus_jack
3 Replies
4. Shell Programming and Scripting
Hi,
I am a bit confused ,why would a sed command work fine outside of ksh script but not inside.
e.g
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
8 Replies
5. Shell Programming and Scripting
I am using a variable called $variable in a pattern search to print from a starting variable to a constant value. the variable search should be case in sensitive.
i tired using Ip at the end in the below command. but in ksh it is not working.
sed -n "/$variable/,/constant/p" file
i also... (11 Replies)
Discussion started by: johnjs
11 Replies
6. Programming
Hi!
I have two shell scripts - Script1, Script2
Script1, Script2 - have return parameter
Script1 - is calling Script2
in Script2 I am calling program sqlldr - if this program is called then I did not get the return parameter from Script1
Do You have any idea how can I avoid this problem.
Mroki (6 Replies)
Discussion started by: mroki
6 Replies
7. Shell Programming and Scripting
Hi,
I have a problem with a SED script that works fine on AIX but does not work properly on a Solaris system.
The ksh script executes the SED and puts the output in HTML in tables.
But the layout of the output in HTML is not shown correctly(no tables, no color). Can anyone tell if there is... (7 Replies)
Discussion started by: Faith111
7 Replies
8. 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"
If found,
2. Append new line with text "hoi"
I tried:
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
7 Replies
9. Shell Programming and Scripting
I have a script that "runs" a script. For example:
./runscript.ksh pcnmc01.ksh
runscript puts pcnmc01.ksh into the background with log output going to the logfile.
After executing the command, I get this output:
Running script in the background: pcnmc01.ksh
Logfile:... (2 Replies)
Discussion started by: Eben Yong
2 Replies
10. Shell Programming and Scripting
In a Korn shell script I have,
cat ../header | sed -e 's/flag1/$cnumb/g' > header.txt
The header is short
{{Company flag1}}
But the result in header.txt is
{{Company $cnumb}}
The value of $cnumb is 120. I am trying to get the value of $cnumb into the header.
I have tried /'$cnumb'/g,... (10 Replies)
Discussion started by: jcarrott
10 Replies