LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-10-2005, 05:58 AM   #1
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 351

Rep: Reputation: 31
perl problem


I am trying to create my first perl scripts...

Quote:
#!/usr/bin/perl

my $i= `rlogin 192.168.0.1 -l admin -p 22 --exec '..<command>....'` ;
print $i;
my $x = `$i | awk '{print $10}'`;
print $x;
my $x = `$input | awk '{print $10}'`;

this command is wrong! how can i filter the $input text??

thx
 
Old 10-10-2005, 07:48 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
why are you calling awk from perl !?!?!?!?!

try something like this:

Code:
#!/usr/bin/perl

open OUT, "/bin/ls -l |" or die;

# print first and 9th field

while (<OUT>) {

    @line = split;
    print "$line[0], $line[8]\n";
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PERL problem linuxlover1 Programming 3 10-09-2005 02:39 AM
Problem with perl module for w3c validator to work on my local Apache+PHP+perl instal tbamt Linux - Software 0 12-16-2004 05:37 PM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 07:45 PM
Perl Problem ShadowPeo Linux - Software 2 02-08-2003 05:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration