Hello everyone,
I'm writing a script to add a string to an XML file, right after a specified string that only occurs once in the file. For testing purposes I created a file 'testfile' that looks like this:
1
2
3
4
5
6
6
7
8
9
And this is the script as far as I've managed:
... (2 Replies)
Can I get some help on this please, I have looked at the many post with similar questions and have tried the solutions and they are not working for my scenario which is:
I have a text file (myfile) that contains
b_log=$g_log/FILENAME.log
echo "Begin processing file FILENAME " >> $b_log
... (4 Replies)
Hi,
I am trying to separate the directory from the filename using the substring and it does not like it.
$Complete_name="C:\ABCD\Reports_Split\090308.1630"
I want $File_Name as 090308.1630
I tried using Substring function and it does not like slashes in the complete_name.
Any... (5 Replies)
Hi,
I want to erase the contents of a file and write a sql query into the file.
"" > tmp.txt
"select count\(\*\) \"Names\" from v\$ground where status\=\'Invalid\'\;" > tmp.txt
doesnt work, pls help. (2 Replies)
Hi there,
I'd like to write a script that removes any set of character from any string. The first argument would be the string, the second argument would be the characters to remove. For example:
$ myscript "My name's Santiago. What's yours?" "atu"
My nme's Snigo. Wh's yors?
I wrote the... (11 Replies)
Hi All,
I have a variable like
AVAIL="\
BACK:bkpstg:testdb3.iad.expertcity.com:backtest|\
#AUTH:authstg:testdb3.iad.expertcity.com:authiapd|\
TEST:authstg:testdb3.iad.expertcity.com:authiapd|\
"
What I want to do here is that If a find # before any entry, remove the entire string... (5 Replies)
Hi,
I have a unix file with contents as below
Line1: ABC MNN X$$QWERTY$$ JKL
Line2: HELLO $$HOW$$ ARE $$YOU$$ DOING
i want to extract the string between $$ and $$ ie i want the output as QWERTY
HOW YOU
i want those strings seperated by some character say |
desired output is... (7 Replies)
Hi,
I have string like this ="Lookup Procedure"
But i want the output like this Lookup Procedure
=," should be removed.
Please suggest me the solution.
Regards,
Madhuri (2 Replies)
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)