Dear all
I had two separate variable. Now i want to make them merge into one new variable with space between them. Kindly suggest me.
var1=dec 15
var2=10
i want var3=dec 15 10
My main aim is as below:
op of date command:
>date
>Sat Dec 15 10:17:35 IST 2007
i want only Dec... (2 Replies)
Hi
I need to write a script where there the user enters 3 input parameter
variable
number
the program should ask the user left or right
if it is left , the number specified that many spaces should be added to the value in front of the value and saved in the samee variable itself and if it is... (5 Replies)
Hey , I'm new to Bash and am having trouble with writing a script.
I have a variable and want to use it to create a tar file, but, I am having problems. Can anyone tell me what I'm doing wrong?
filestr=`date "+%y-%m-%d %H.%M.%S"`.tar
tar -cvf $filestr test.txt
So, basically,... (3 Replies)
Hi,
I have a large flat file from host without delimiter. I'm transforming this file to a csv file using statements like
# Row 03: Customer / field position 3059 +20
WOFABNAM=substr( $0, 3059, 20 );
and deleting the trailing whitespaces before and after with that
sub( /^ +/, "",... (4 Replies)
This seems to be a stupid basic question, but I cant get the space to stick in the awk variable.
I do use this command to grep a time range of the log file.
cat /var/log/daemon.log | awk '$0>=from&&$0<=to' from="$(date +%b" "%e" "%H:%M:%S -d -24hour)" to="$(date +%b" "%e" "%H:%M:%S)"
I now... (9 Replies)
Hi all,
Hope someone can help me out here.
I have this BASH script (see below)
My problem lies with the variable path.
The output of the command find will give me several fields. The 9th field is the path. I want to captured that and the I want to filter this to a specific level.
The... (6 Replies)
Hi,
Consider the data (FS = |):
1| England |end
2| New Zealand |end
3|Australia|end
4| Some Made Up Country |end
5| West Indies|end
I want the output to be (i.e. without the leading and trailing white space from $2)
England
New Zealand
Australia
Some Made Up Country
West... (4 Replies)
I created a awk state to calculate the number of success however when the query runs it has a leading zero. Any ideas on how to remove the leading zero from the calculation?
Here is my query:
cat myfile.log | grep | awk '{print $2,$3,$7,$11,$15,$19,$23,$27,$31,$35($19/$15*100)}'
02:00:00... (1 Reply)
Hi All,
I did a review of some threads to see if someone had come across this problem.
My system is an oracle virtual box solaris 10 installed on a windows 10 system.
Right now I am learning scripting and am just playing with the env variables.
I am trying to update the PATH to... (9 Replies)
Discussion started by: bdby
9 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)