Search Linux Wireless

Re: [PATCH] compat-2.6: Makefile: fixed test expressions for target install

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/30/2009 11:42 PM, Pavel Roskin wrote:
On Thu, 2009-07-30 at 23:25 +0200, Joerg Albert wrote:
This removes the two errors of [ with target "install"

make[1]: Leaving directory `/home/joerg/src/linux-2.6.30'
[: 9: missing ]
[: 9: missing ]
depmod will prefer updates/ over kernel/ -- OK!

I believe "-a" in test is not very portable.  I remember getting
complaints about it.  I believe the built-in test command in bash 1.x
doesn't have it.  I'd rather stick with && and || written properly.

"-a" and -o" are currently only used in the clean target and in the
maintenance scripts, so they probably don't get enough testing on
systems with old bash.

Bash 3.2.39 seems to have a problem with &&, while [[ ... ]] accept it:

joerg@thinkpad:~$ echo $BASH_VERSION
3.2.39(1)-release
joerg@thinkpad:~$ if [ -z "" && -z "" ]; then echo "both empty"; fi
bash: [: missing `]'
joerg@thinkpad:~$ if [ -z "" -a -z "" ]; then echo "both empty"; fi
both empty
joerg@thinkpad:~$ if [[ -z "" && -z "" ]]; then echo "both empty"; fi
both empty
joerg@thinkpad:~$

If the link for the man page of bash v1 on http://wwwbs.informatik.htw-dresden.de/fbs/bash/old.bash.html is correct,
that version supported -a in test.
Unfortunately [[ ... ]] was introduced after bash v1 (2.02 AFAIR).

Regards,
Joerg.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux