11-24-2008
It's not clear what you're trying to achieve.
What is the practical business problem you are solving?
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
How to find the last argument in a argument line? (4 Replies)
Discussion started by: nehagupta2008
4 Replies
2. Shell Programming and Scripting
What is the sake of using `use strict;` in perl codes? and how can avoid it?.TnX. (8 Replies)
Discussion started by: Zaxon
8 Replies
3. Shell Programming and Scripting
Can someone please help me with this SHELL script?
I need to create a script that gets a positive number n as an argument. The script must calculate the factorial of its argument. In other words, it must calculate n!=1x2x3x...xn. Note that 0!=1.
Here is a start but I have no clue how to... (3 Replies)
Discussion started by: I-1
3 Replies
4. Shell Programming and Scripting
I opened strict.pm and found some not understandable stuff, please let me know if you have any Idea on the same.
1) Line 23 => $bits |= (what is $= here how it affect the statement)
2) Line 36 => $^H (what is that I haven't found any statement on this in google)
3) Line 41 =>... (3 Replies)
Discussion started by: jatanig
3 Replies
5. Shell Programming and Scripting
If ($argv == “-debug”) then
Echo “in loop”
Endif
But this is not working. If I modify this code and remove “-“, then it works.
Similarly I am getting problem using grep command also
Grep “-debug” Filename
Can someone please help me on how to resolve these... (1 Reply)
Discussion started by: sarbjit
1 Replies
6. UNIX for Advanced & Expert Users
Hi All,
I am running the script
VBoxManage list vms |sed 's/"//g' | cut -d " " -f1 > har1out.mytxt
result=`cat har1out.mytxt | grep $1'
echo $result
echo $1
{
if
then
echo pass
else
echo fail
fi (2 Replies)
Discussion started by: harsha85
2 Replies
7. Shell Programming and Scripting
I installed gcc4 today using setup.exe from cygwin. However, I cannot run any of my perl program after that. For example,
Run@Run-THINK /home
$ perl Process.pl
Can't locate strict.pm in @INC (@INC contains: /usr/lib/perl5/5.10/i686-cygwin /
usr/lib/perl5/5.10... (0 Replies)
Discussion started by: littledeer
0 Replies
8. UNIX for Advanced & Expert Users
What are the different ways to disable ssh strict checking? I've seen this mentioned a few times but it doesn't seem to be working.
$ ssh -o 'StrictHostKeyChecking no' admin@hostnamehttp://docs.oracle.com/cd/E35328_01/E35336/html/vmcli-ssh.html
Is there a file somewhere in /etc that I could... (4 Replies)
Discussion started by: cokedude
4 Replies
9. Shell Programming and Scripting
How do I get past the error when using strict and GetOpts ?
#!/usr/bin/perl
use strict;
use Getopt::Std;
# Process the command line options
die "Usage: $0 -r <router> -u <username> -p <password> -e <enable password>\n" if (@ARGV < 6);
exit if (!getopts('r:u:p:e:'));
my... (3 Replies)
Discussion started by: popeye
3 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)