in reply to different terminal
if you re running in a Linux environment and want a script to collect the results of running a command (or commands) why bother with a terminal at all? Something like this should work (weak example):
#!/usr/bin/perl -w use strict; my $cmd=qq@ date who ps -ef netstat -i ifconfig -a ) | @; open CMD, $cmd or die $cmd . ":$!"; my @lines=<CMD>; # slurp! close CMD; chomp @lines; # do something here.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: different terminal
by GotToBTru (Prior) on Jun 10, 2014 at 17:12 UTC | |
by davido (Cardinal) on Jun 10, 2014 at 17:23 UTC | |
by NetWallah (Canon) on Jun 10, 2014 at 17:24 UTC | |
by blue_cowdawg (Monsignor) on Jun 10, 2014 at 17:47 UTC | |
by shmem (Chancellor) on Jun 11, 2014 at 07:11 UTC | |
by blue_cowdawg (Monsignor) on Jun 10, 2014 at 17:42 UTC | |
by LanX (Saint) on Jun 10, 2014 at 17:49 UTC | |
by blue_cowdawg (Monsignor) on Jun 10, 2014 at 17:52 UTC |