Unix questions - how to use PERL variable in UNIX command line

This is Interesting: Free IT Magazines  
Home > Archive > Unix questions > August 2006 > how to use PERL variable in UNIX command line





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author how to use PERL variable in UNIX command line
niki.cho@gmail.com

2006-08-01, 7:25 pm

Here is the example.

print "write down the filer: \n";
chomp($myfiler = <STDIN> );

my $out = `rsh -l root: blabla $myfiler blablabla `


I am not sure how to make the above line works.
Thank you for your advice in advance.

Kevin Collins

2006-08-02, 7:22 pm

In article <1154469386.681248.85990@m73g2000cwd.googlegroups.com>,
niki.cho@gmail.com wrote:
> Here is the example.
>
> print "write down the filer: \n";
> chomp($myfiler = <STDIN> );
>
> my $out = `rsh -l root: blabla $myfiler blablabla `
>
>
> I am not sure how to make the above line works.
> Thank you for your advice in advance.


Well, if you had correct rsh syntax, it would probably work - the PERL part
appears correct. A couple reasons it might not work:

1) the userid you are telling rsh to login as is "root:" and probably should be
"root"
2) the userid you are running as has no permission to rsh as root
3) you don't specify a host to the rsh command before your '-l root'

Something like this is probably what you want:

my $out = `rsh my_remote_host -l root /some/command $myfiler`

Kevin


--
Unix Guy Consulting, LLC
Unix and Linux Automation, Shell, PERL and CGI scripting
http://www.unix-guy.com
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com