Hi Dakenah Dakenah Johnson wrote: > Hi > I am writing a script that uses backquotes and the ps-ef command to print > the UID and command for all currently running processes.
> #!/usr/bin/perl > use strict; Good!, but also use warnings; > my $process = `ps -ef`; This will pull all the lines of the 'ps' output into a single string in $process. Is that what you want or would it be easier to have each line in a separate array element like this? my @process = `ps -ef` > while (<>);{ This is trying to read data lines from all of the files that you specified on the command line if there were none it will try to read from STDIN (often the keyboard). > push @process = spilt (/\|/,$_); This will split each line from those files on the 'pipe' character. I'm now lost as to what you're trying to do as, as far as I know, you have no command-line parameters and there are no 'pipe' characters in the output of 'ps'. > print "Owner:[1] command:[8] Curiouser and curiouser! It looks somhow like you're trying to access arrays, but which ones? Evene if your quotation mark were terminated above, what you would be printed is simply Owner:[1] command:[8] which I doubt is what you want! > where did I go wrong? It depends on what you were trying to do! Why not start here and see if you can get seomthing useful from it. my @process = `ps -ef`; foreach my $ps (@process) { chomp; print $ps, "\n"; } This will simply display the output of 'ps' as it is arrives, but at least you have each line in a variable and can do with it as you will. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]