This might sound little familar to you guys, but am struck with something.
i have an IF conditioned loop which will determine a variable to get used in the later part of the script.
Now, when am using this Var_name in the later part of the script as mentioned below, its appearing as a whole line.
Please let me know what am doing here.
Note : I tried using single commands of echo -e "\n" in a shell script, its working fine. But when i tried to execute in a 50 lines shellscript its not working.
I tried to search in the forum ,for solutions, but am not able to find it. Hence , am posting a new thread.
Thanks,
P
Last edited by Scott; 10-31-2013 at 01:40 PM..
Reason: Please use code tags
This method i have tried, but its not working as expected.
Let me give the complete overview of it ,
The Var_name is used as an variable to display the values in the HTML format table cell in mail as mentioned below,
Its not appearing as
Could you please suggest here ?
Last edited by Scott; 11-01-2013 at 06:46 AM..
Reason: Code tags
Now, in the same script, am using the same variable Var_name in an sed function to be parsed to replace a value with the variable value.
Original code :
and its failing to get replaced,
Sed: Function s/oldvalue/##This is First Line. <br> cannot be parsed.
Is there any other options which we can do to get sorted.
MadeInGermany is correct, but you probably want to know why:
If you check the HTML source code you produce you will see that indeed there are three lines as Scott said and suggested. HTML source code, though, is not displayed as it is when you display it using a web browser. The browser interprets it and part of this interpretation is to "interpret away" the line breaks.
MadeInGermany just put the HTML equivalent of line breaks (the "<br />" tags) into the text, which will - when interpreted by a web browser - produce line breaks. Notice, that your text will, when showed in a web browser, look the same if you write:
or
because the "away-interpretation" of real line breaks works both ways: the browser simply ignores them and it will also ignore their absence.
I hope this helps.
bakunin
/PS: remove the (real) line breaks from your variables content, the browser would ignore them anyway. Their existence is probably the reason why your sed-statement is failing: web browsers ignore line breaks, but sed does not.
Hello,
I have written a command n shell script :
srvctl relocate service -d t1 -s s1 -i i1 -t t1 -f
If the above command executes successfully without error I need to echo
"Service relocated successfully
and If it errors out I need to trap the errors in a file and also need to make... (1 Reply)
Hello,
I have a very basic script
#!/usr/bin/ksh
while
print ' '
print ' 1. View Command History '
print ' 2. List files in current Directory '
read opt'?Enter Option> ' ;do
if ;then
fc -l
fi
#
if ;then
ls -la
I want to... (10 Replies)
Hi,
I try to write script and echo two command at the same line .
echo "A"
echo "B"
How can I pipe above two command at the same line in text file .
So, in the output text file , you can see below ???
A B
not
A
B
Any sugggestion ??? (4 Replies)
Hello,
I'm writing some bash scripts and I'm trying to get an echo command and the output of another command to display on the same line. For example:
I want to run
echo "Operating System: " unameand have it displayed as
Operating System: Darwin
Thanks for your help! (7 Replies)
Hi
I want to display "echo command value in loop" in single line. My requirement is to show the input file (test_1.txt) like the output file (test_2.txt) given below.
Input file :test_1.txt
a1|b1|4|5
a1|b1|42|9
a2|b2|32|25
a1|b1|2|5
a3|b3|4|8
a2|b2|14|6
Output file:test_2.txt... (2 Replies)
Hi
i would like disply the new line in echo command.
i have input like:
echo " X1 02:12:13 X2 03:02:12 "
out put:
X1 02:12:13
X2 03:02:12
can you tell how can use new line option in echo command. (5 Replies)
I have script like
echo -n FINISHED FEXP: ${TABLE2EXP}
echo $STATUS
I want the output of both the echo statement in one line
How can i do this (3 Replies)
hello,
i have a listing (let say ABC) consists of the below:
:
public database link
public synonym
role
rollback segment
:
when i run the below for loop,
for i in `more ABC`
do
echo "$i"
done
it gives me,
:
public
database (4 Replies)