Why doesn't this:
PS_OUTPUT=`ps -ef`
echo ${PS_OUTPUT}
produce the same output as this:
ps -ef
ie. The same number of lines.
TIA!
PS_OUTPUT=`ps -ef`
echo ${PS_OUTPUT}
produce the same output as this:
ps -ef
ie. The same number of lines.
TIA!
The normal behaviour of the backtick (`...`) expansion is to delete trailingQuote:> Why doesn't this:
> PS_OUTPUT=`ps -ef`
> echo ${PS_OUTPUT}
> produce the same output as this:
> ps -ef
> ie. The same number of lines.
line 1
line 2
...
...
assigned to your shell variable, you get:
line1 line2 ... ...
I hope this helps, in terms of explaining the observed behaviour.
Make itQuote:> Why doesn't this:
> PS_OUTPUT=`ps -ef`
> echo ${PS_OUTPUT}
> produce the same output as this:
> ps -ef
> ie. The same number of lines.
echo "$PS_OUTPUT"
1. <><><> MOUNTING EXTENDED PARTITION <><><>
I have a 10 GB UDMA IDE drive formatted with Windows. The first partition
is FAT32, and the second is NTFS. I can successfully mount the first, but
not the second. Any ideas?
Suse 7.2 on i86
the drive is mounted on /dev/hdc, and I CAN see hda1, but not hda2
2. Having trouble with modem and PPP
3. Wanted: <><><> Unix Specialist <><><>
4. Unable to write over 20GB to DDS-4 tape
7. <CR> Carriage Return, how to match this in Shell???
8. Colorado Jumbo 250 / FTape : Available NOW?
10. *{<><>}*Linux*Screen*Difficulties*{<><>}*
11. << <<anyone using dyn-html?>> >>
12. (<><>)*Linux*Screen*Difficulties*(<><>)
13. Samba problem: WinXP <-> ADSL <-> Internet <-> Cable <-> Linux