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)
Check Out this Related Man Page
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)
hi, :)
pls consider the following if statement
if //g') ]
then
........
else
.......
when i execute the script i am getting the following error
'(' unexpected
I am not able to find the mistake.
could anybody tell where i did mistake.
cheers
RRK (13 Replies)
Here is the script that i am trying to run. I get an error and i can't figure out what is the problem.
#!/bin/bash
echo "What is your name"
read NAME
if ; then
echo "My name is the same"
esle
echo "You have a nice name"
fi (11 Replies)
Im trying to get the frist two line of a file as a variables.
input file
/tmp/tmp.txt
1226037463l
1226037422ll
while read -r LINE
do
if ;
then
FRIST=`echo $LINE | awk -F"|" 'NR==1''{print $1}'`
echo $FRIST
SECOND=`echo $LINE | awk -F"|"... (37 Replies)
how to pass value through FTP.Below the script in k-shell
echo "Enter the month/day"
read value
ftp -v -n ddcappip031.tu.com << "EOF"
user amit jason
prompt
cd /ednpdtu7/u01/pipe/Incoming/CurrentCollector/MeterReads/backupfiles
mget CurrentCollectorMeterReadBackup2008'$value'.tar.gz... (13 Replies)
ps -eaf | grep “oracleTRLV (LOCAL=NO)” | while read ora_proc
do
echo $ora_proc
done
I would like to modify the above shell so that if character 13 and 14 equal "12" to do something.
Sorry I'm new to shell:( (14 Replies)
Is there an option for negation in the "tr" command?
For eg:
echo hi | tr "h" "i"
will print "ii".
But if I want to covert all characters that are not "h" to "j", how do I do that?
Is there something like "!" in tr? Or any switch?
Thanks,
Prasanna (17 Replies)
Hi All
I recently installed Ubuntu on my computer. For using the mailx function what are the pre necessary condition which should be configured so that when when i use the mailx option the mail should go to the intended users. (12 Replies)
Hi All,
I would like to do the following in the shell script
561.76 to 562
I tried using this echo 'scale=0; 749 * 75 /100 ' | bc
but just returned only 561
Please help me . I appreciate your help
Thanks
rajeevm (13 Replies)
Sorry folks, Second time today.
I am working on a script that accepts data via pipe and processes it.
I expect it to work as:
# command | ProcScript.sh
Within ProcScript.sh, I want to be able to give the target of the prev run command
I am using history 2 | grep -v history | awk... (18 Replies)
Hi All,
I'm having some problems with my shell script. When running the script I get the following errors:
line 101: <html>: command not found
line 105: /dumpfile.txt: No such file or directory
The file dumpfile.txt does exist and I have double and tripple checked this. I'm not sure... (14 Replies)
Behavior I am looking for:
$ for var in a 'b c'; do echo $var; done
a
b c
What I am getting when I try to use a variable:
$ test="a 'b c'"
$ for var in $test; do echo $var; done
a
'b
c'
Is there a workaround?
Mike (16 Replies)
Hi
I want to check delimiter in file. Delimiter in my file is ~|*
sample of file :
ABC~|*edgf~|*T1J333~|*20121130
ABC~|*sdaf~|*T1J333~|*20121130
ABC~|*fsdg~|*T1J333~|*20121130
ABC~|*dfsg~|*T1J333~|*20121130
in this i want to count number delimiter occur is 4 in each row if count is... (21 Replies)
Hi
i had written one script,it sends email from terminal and mine script is as:
#!/bin/bash
SUBJECT="linux mail send attachment example"
BODY_FILE="/home/sreenivasa/Desktop/Testing.txt"
#ATTACHMENT_FILE="/home/sreenivasa/Desktop/Dataset.zip"... (23 Replies)