CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Why doesn't this work?

 



aixrus
New User

May 21, 2010, 10:51 AM

Post #1 of 6 (1178 views)
Why doesn't this work? Can't Post

At the command line (aix):

# bootinfo -s hdisk1
34715

In perl:

$size=`bootinfo -s hdisk1`;

bootinfo: A flag requires a parameter: s
usage: bootinfo { -a | -b | -B device | -c | -d | -e | -f device |
-g device | i | -k | -K | -L | -m | -M | -o disk | -p | -q device |
-Q number | -r | -s diskname [ -P 0 ] | -t | -T | -v | -w | -y | -z }



???


toolic
User

May 21, 2010, 4:52 PM

Post #2 of 6 (1169 views)
Re: [aixrus] Why doesn't this work? [In reply to] Can't Post

Just a guess... maybe the bootinfo from the command line is a different executable from that in the Perl script.

I am unfamiliar with AIX and bootinfo, but in unix-like OS's, I would do this at the command line:


Code
which bootinfo


and I would inspect the PATH variable inside the Perl code:


Code
print $ENV{PATH};



aixrus
New User

May 24, 2010, 11:56 AM

Post #3 of 6 (1142 views)
Re: [toolic] Why doesn't this work? [In reply to] Can't Post

Well, no it is finding the command. So it isn't a path issue.



The error has to do with the flag not getting an expected paramter passed to it.

Here is the code:

else {
$size=`bootinfo -s hdisk1`;
}


Here is the error again run through perl:

bootinfo: A flag requires a parameter: s
usage: bootinfo { -a | -b | -B device | -c | -d | -e | -f device |
-g device | i | -k | -K | -L | -m | -M | -o disk | -p | -q device |
-Q number | -r | -s diskname [ -P 0 ] | -t | -T | -v | -w | -y | -z }


Here is the output at the command line:



#bootinfo -s hdisk1
34715


7stud
Enthusiast

May 24, 2010, 12:37 PM

Post #4 of 6 (1138 views)
Re: [aixrus] Why doesn't this work? [In reply to] Can't Post


Quote
Well, no it is finding the command


Yeah, but the idea is *which* command is it finding. You can have 50,000 executables on your computer called bootinfo.


l4teral
User

May 25, 2010, 2:25 PM

Post #5 of 6 (1114 views)
Re: [7stud] Why doesn't this work? [In reply to] Can't Post

you can try substituting backticks for system(" ");


...that's fixed quirks like that for me, in the past.


rovf
Veteran

May 26, 2010, 7:07 AM

Post #6 of 6 (1109 views)
Re: [aixrus] Why doesn't this work? [In reply to] Can't Post

What shell are you using?

Could it be that bootinfo in your shell is an alias or a function?

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives