Here is my test script:
#!/bin/sh
result=`jobs`
echo "
Jobs:
"$result
result=`ls`
echo "
LS
"$result
Here is the output:
Jobs:
LS
0 1 2 3 4 5 6 7 gcd initialize.sh #inter_round_clean.sh# inter_round_clean.sh inter_round_clean.sh~ look parallel_first_run.sh parallel_ith_run.sh README.txt test testscript.sh testscript.sh~
But when I enter "jobs" from the command line I get this:
[2] Running emacs inter_round_clean.sh &
[3]- Running emacs ../todo.txt &
[5]+ Running emacs testscript.sh &
Why isn't jobs behaving the same was as ls?
p.s. I tried the exact same thing but with $() instead of backticks and got the same result.