12-04-2009
Thanks!
It seems that I if I echo it to the screen it works, but when I save it in a file (>> inserts), it splits the lines by spaces.
Does this happen to you too?
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I'm trying to modify the /usr/lib/lp/model/netstandard file to generate a header for all the print jobs that are sent, but there is no formfeed defined so the the job prints right after the header with no page break. What is the sequence I need in order to generate a formfeed? Or, do you have... (4 Replies)
Discussion started by: jgordon
4 Replies
2. Shell Programming and Scripting
Hi,
I am trying to execute the following command from a batch script, but no matter how many escape characters I put in it doesn't execute properly. It works fine from the command line with quotes around the -exec part.
#!/bin/sh
/usr/local/bin/sudo /usr/atria/bin/cleartool setview -exec... (0 Replies)
Discussion started by: Sebarry
0 Replies
3. Shell Programming and Scripting
hey
i want to know the unix commands to replace all the character escape sequences with their "C" values in a string...
thanks in advance..!
Regards,
Sharanya (9 Replies)
Discussion started by: sharsin2001
9 Replies
4. Shell Programming and Scripting
Hi all
I have been trying to write a script to look for a set of specific escape characters in a file. On viewing the file via vi it shows this :
^ I understand this means no end of line.
I have tried a vary of grep parameters such as grep ^\^. filename grep --binary-file=binary without... (8 Replies)
Discussion started by: timcs
8 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I want to know if escape charaters work on all the popular UNIX shells. More specifically I want to know if echo "\c" will work on most of the UNIX shells and are there any specific shells on which \c won't work.
Please help.
Thanks,
Vineet (2 Replies)
Discussion started by: vineetd
2 Replies
6. Shell Programming and Scripting
I have a file with the following contents
# more hello.txt
man
hello man
whereru
The shell script i have tries to echo the contents of the file hello.txt
for i in `cat hello.txt`
do
echo $i
done
but the output i am getting is taking the space as a new line..
#... (3 Replies)
Discussion started by: Tuxidow
3 Replies
7. Shell Programming and Scripting
i need to replace the any special characters with escape characters like below.
test!=123-> test\!\=123
!@#$%^&*()-= to be replaced by
\!\@\#\$\%\^\&\*\(\)\-\= (8 Replies)
Discussion started by: laknar
8 Replies
8. Shell Programming and Scripting
i am executing script from A server which will execute the script in B server , as below.
ssh A 'ssh B echo 'select * from testing where name ='test''
i am getting the below output.
select * from testing where name=test
but i need the output where clause with quotes , tried with... (3 Replies)
Discussion started by: expert
3 Replies
9. Shell Programming and Scripting
I have an application which I am integrating with that accepts the password via a CLI. I am running in to issues with passwords that contain special characters. I tried to escape them all, but I ran in to an issue where I cannot escape the characters
'
]
My attempt is as follows:
$... (2 Replies)
Discussion started by: AMG1978
2 Replies
10. Shell Programming and Scripting
Debian 9 64x - LXDE
How can i disable escape sequences in a variable?
#!/bin/bash
#mainscript
. "./links.bash"
echo "$red_start This text should be red $color_end"#!/bin/bash
#links.bash
#colors
red_start="\eOutput that i get:
\e
Output expected:
This text should be... (5 Replies)
Discussion started by: int3g3r
5 Replies
LEARN ABOUT OPENDARWIN
escape
escape(1) Mail Avenger 0.8.3 escape(1)
NAME
escape - escape shell special characters in a string
SYNOPSIS
escape string
DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result.
EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string:
$ var='; echo gotcha!'
$ eval echo hi $var
hi
gotcha!
$
Using escape, one can avoid executing the contents of $var:
$ eval echo hi `escape "$var"`
hi ; echo gotcha!
$
A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For
example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient:
#!/bin/sh
formail -x to -x cc -x resent-to -x resent-cc
| fgrep "$1" > /dev/null
&& exit 0
echo "<$1>.. address does not accept blind carbon copies"
exit 100
To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt
script:
bodytest reject_bcc `escape "$RECIPIENT"`
SEE ALSO
avenger(1),
The Mail Avenger home page: <http://www.mailavenger.org/>.
BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells.
AUTHOR
David Mazieres
Mail Avenger 0.8.3 2012-04-05 escape(1)