I am very new to scripting in UNIX and in need of help. I am creating a program that will check a file that has a target time in the form of HH:MM:SS before another program can begin executing. The file with the target time will only have that target time in it and nothing else.
Is there any way... (1 Reply)
I am very new to scripting in UNIX and in need of help. I am creating a program that will check a file that has a target time in the form of HH:MM:SS before another program can begin executing. The file with the target time will only have that target time in it and nothing else.
Is there any... (4 Replies)
Hi,
I have a UNIX script which has two parts:
1. It connects to a database and refreshes a materialized view
2. It then connects to another database and inserts refresh statistics to a table
The script works, but I'm not too good at UNIX validation. Currently, if the first part of the job... (1 Reply)
Hi All,
I got a file with 3 fields delimited by hyphen "-". I have to validate & cleanse the data before i begine the processing
Requirements
1. No record should contain more than 2 delimiters
2. No record should even contain less than 2 delimiters
3. Any records that matches rule 1 &... (1 Reply)
Hi All,
I got a file with 3 fields delimited by hyphen "-". I have to validate & cleanse the data before i begine the processing
Requirements
1. No record should contain more than 2 delimiters
2. No record should even contain less than 2 delimiters
3. Any records that matches rule 1 &... (3 Replies)
Hi All,
I got a file with 3 fields delimited by hyphen "-". I have to validate & cleanse the data before i begine the processing
Requirements
1. No record should contain more than 2 delimiters
2. No record should even contain less than 2 delimiters
3. Any records that matches rule 1 &... (8 Replies)
My data is something like shown below.
date1 date2 aaa bbbb ccccc
date3 date4 dddd eeeeeee ffffffffff ggggg hh
I want the output like this
date1date2 aaa eeeeee
I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
I have a script which is take date as parameter
sh abc.sh <2010-02-01>
#!/sh/bin
my_date=$1
#Here i want to two diffrent dates
## 3 Days before
##date14query=$mydate - 4 (it will be 2010-01-28)
##date24query=$mydate +4 (it will be 2010-01-05)
#Please Help (3 Replies)
Dears,
I am working on a batch that processes file with name containing date prefix eg., 20101222_file.dat.
The logic is to process files in order. Eg., 20101225 must be processed only after 20101222.
Ok first glance it looked simple, it use a variable to check this date value as number and... (2 Replies)
Please help me to validate PAN card using unix
---------- Post updated at 03:06 AM ---------- Previous update was at 02:21 AM ----------
1) The first three letters are sequence of alphabets from AAA to zzz
2) The fourth character informs about the type of holder of the Card. Each assesse... (1 Reply)
Discussion started by: suryanarayana
1 Replies
LEARN ABOUT DEBIAN
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)