[Pdx-pm] solved: job control (still got a question)
nforrett at wgz.com
Mon Jun 2 18:22:30 CDT 2003
On Mon, 2 Jun 2003, Randall Hansen wrote:
> First, thanks for everyone's help. I have one nagging question
> (immediately below) and then a brief explanation of what I was
> At this point the only thing that confuses me is the output
> $ perl -e "print `jobs`"
The reason why your example is not working is because it is the shell
processing the backticks.
$ perl -e "print `jobs`"
is processed as follows:
- The shell sees the double quotes and performs its own interpolation.
- The shell sees the backticks, so it runs the jobs builtin.
- The shell takes the output of jobs and substitutes it for the backticks.
- After the shell is finished, it is as if you typed the following at your
perl -e "+ Stopped pine (wd: /usr/src)"
The contents in the quotes are not legal perl, and that is why it is
complaining. If this is good enough for you, try the following:
perl -e "print \"`jobs`\""
After shell backtick processing you end up with:
perl -e "print \"+ Stopped pine (wd: /usr/src)\""
Which results in the following perl getting executed:
print "+ Stopped pine (wd: /usr/src)"
More information about the Pdx-pm-list