Hi, i have this script
setenv.sh
The following is the result when i run the script from command without and with a dot and space operator
$ setenv.sh
is empty
done
$ . setenv.sh
sh: VAR_1: Parameter not set.
$
It's our standard to run with dot and space, and ever since i added code to check if the variable is empty it throws out this error and doesn't run the next lines
I am using a Sun Ultra 30 with 250MG of RAM and 9GIG of hard drive. I connect to the machine via Exceed 6 and have the Oracle8i for Solaris in the cdrom drive. I have read and complied with Oracle's instruction in preparation to installing Oracle. Since I don't have enough space to cp the content... (1 Reply)
Having the following message returned:
FIND REDLOG FILES.....
ksh: dbfFILe: parameter not set
When I attempt to perform the script below....#!/bin/ksh
. $HOME/.profile
# Initial Script Prerequisites
ORACLE_SID=MDirect ; export ORACLE_SID
REDOLOGDIR=$ARCLOGDEST ; export REDOLOGDIR... (2 Replies)
hi, linux gurus...
i'm trying to write a script in ksh called ResetPass that allows a user to change mysql passwords. the script accepts user, password and host like this: ResetPass <user> <password> <host>. here's the code:
*****************************************************
mysql... (1 Reply)
Hi...
i need a script to remove the space before and after the operator like( +, -, ||, &&).
Ex :
Input file
apple + manago
mango && fresh + apple fresh || fruit
Desired output:
apple+manago
mango&&fresh+apple fresh||fruit (6 Replies)
Hi
I have a "set" command which ends with a "." (dot), for example:
set `grep "\<${pnum}\>" /tstmp/data.txt |sed 's/#//'` .
Can somebody help me to understand the purpose of this "set" and "." combination?
The problem is that this command does not produce the same result when run on AIX... (2 Replies)
OS SCO Open Server 6.0 MP4
I am trying to change the value of a enviornment variable thru a script and want to pass a parameter on the commande line, If I hard code the value inside the script the script changes the enviornment variable
. mytest
where my test is
MYVAR=$1
export MYVAR... (6 Replies)
Hi,
Could you please tell me how nawk command works when there is a asterisk <*> or space with asterisk < *> or <* > in the parameter.
I am just trying to read line by line and fetch fourth parameter separated by delimiter (|).
But if there is a * or < *> or <* > in the fourth parameter it... (7 Replies)
Hi,
I have this following code which gives me error when compiling. The problem is happening at the point where I create a const_iterator inside the overloaded insertion operator (i.e) operator << () function. The template argument version of set is not correct I guess. Could anyone please pitch... (3 Replies)
My intention is to go through list of addresses and call google geocode api for each of them. I am using lynx for this, but somehow I can't supply the parameters to it in a proper way.
To show that my parameters are OK I just hardcoded one address in my script and put it in my input file, and... (2 Replies)
Discussion started by: migurus
2 Replies
LEARN ABOUT BSD
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)