10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am using UNIX to create a script on our system. I have setup my commands to append their output to an outage file. However, some of the commands return no output and so I would like something to take their place.
What I need
The following command is placed at the prompt:
TICLI... (4 Replies)
Discussion started by: jbrass
4 Replies
2. Shell Programming and Scripting
Hi
I am trying to store the output of a command into an array in perl script.
I am able to store but the problem is i am unable to print the array line with one line space. i mean i inserted the \n in loop ...but not getting the result.
I have written like this
#!/usr/bin/perl
@a =... (2 Replies)
Discussion started by: kumar85shiv
2 Replies
3. Shell Programming and Scripting
Hi, guys, i have a script i inherited from a coworker but i'm not perl savy. The script works but i would like it to work better. I want to run this command
./ciscomgrtest.pl -r "show version" -h hosts.router
and have the script goto each router in the hosts.router file and run the command... (2 Replies)
Discussion started by: whipuras
2 Replies
4. Shell Programming and Scripting
Hello,
I'm pretty stumped, and I don't know why I am not able to redirect the output to the 'graphme' file with the command below in Fedora 18.
tcpdump -l -n -t "tcp == 18" | perl -ane '($s,$j)=split(/,/,$F,2); print "$s\n";' > graphme
In case you're wondering, I was following the example... (2 Replies)
Discussion started by: ConcealedKnight
2 Replies
5. Shell Programming and Scripting
Hello,
I used the following script to conect to cisco router:
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use Opsware::NAS::Connect;
my($host, $port, $user, $pass) = ('localhost','$tc_proxy_telnet_port$','$tc_user_username$','$tc_user_password$');
my $device =... (5 Replies)
Discussion started by: ahmed_zaher
5 Replies
6. Shell Programming and Scripting
Hi All,
How I will read the output of the tail -F command in perl.
I have text file with below contains
file1.txt
1
2
3
4
$running=1;
sub openLog($)
{
(my $log) = @_; (1 Reply)
Discussion started by: pravin27
1 Replies
7. Shell Programming and Scripting
Hi there, just wondered if somebody could help me with a problem I have
I have a program that when run from the command line will output a list of objects
# list_servers
server1
server5
server7
server8
#
I just wanted to know, in perl, how can i make each line of output from... (4 Replies)
Discussion started by: rethink
4 Replies
8. Shell Programming and Scripting
Hi there
could anybody point me in the right direction when it comes to looping through the output of a system command in perl (i.e. df -k) doing a test against each line to see if it matches?
for example if i have a df -k output like this and I wanted to grab the lines that matched "sda" or... (3 Replies)
Discussion started by: rethink
3 Replies
9. Shell Programming and Scripting
Net::SSH::Perl ...... how to print the output in a proper format
my $cmd = "ls -l";
my $ssh = Net::SSH::Perl->new($host);
$ssh->login($user, $pass);
my($stdout, $stderr, $exit) = $ssh->cmd("$cmd");
print $stdout;
the script works fine, but i am unable to see the output... (2 Replies)
Discussion started by: gsprasanna
2 Replies
10. UNIX for Dummies Questions & Answers
Hi folks,
Please advise which command/command line shall I run;
1) to display the command and its output on console
2) simultaneous to save the command and its output on a file
I tried tee command as follows;
$ ps aux | grep mysql | tee /path/to/output.txt
It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies