Im trying to write a bash script that has an if statment that when the user enters ONLY that exact argument, will echo what follows that conditon.
For example:
Basically, if i specify anything other then 1 as this cmd files argument, it wont output anything.
But if i do specify 1 it will output the value that Var1 is holding... Another problem tha t i was having is that it will output when any 1 argument is passed. For example if 2 arguments are passed it wont output anything. If no arguments are passed it wont output anything. But it really doesnt matter what 1 argument i specify, it will output as long as 1 argument is givin.
What im trying to figure out from that point is how to write an if statement that looks for an exact match of that 1 argument that the user would specify.
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)
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)
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)
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)
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)
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)
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)