Actually, [ is a link to test. Linux uses a symlink, some Unixes use hard
links.
-rwxr-xr-x1 root root17496 Sep 20 2001 /usr/bin/test
lrwxrwxrwx1 root root4 Dec 1 13:42 /usr/bin/[ - test
And yes, BASH has it built in, but on some of the older Bourne shells
Jerry Feldman said:
Actually, [ is a link to test. Linux uses a symlink, some Unixes use hard
links.
-rwxr-xr-x1 root root17496 Sep 20 2001 /usr/bin/test
lrwxrwxrwx1 root root4 Dec 1 13:42 /usr/bin/[ - test
And yes, BASH has it built in, but on some of
=Jerry Feldman said:
=Actually, [ is a link to test. Linux uses a symlink, some Unixes use hard
=links.
=-rwxr-xr-x1 root root17496 Sep 20 2001 /usr/bin/test
=lrwxrwxrwx1 root root4 Dec 1 13:42 /usr/bin/[ - test
=
=And yes, BASH has it built in, but on some
On Mon, 22 Apr 2002, Tom Buskey [EMAIL PROTECTED] wrote:
As I said in not so many words, modern shells have it built in. I don't
consider Bourne a modern shell.
I believe Jerry is saying some of the newer implementations of /bin/sh
have [ as a builtin. For example, [ has been a builtin on
That is also correct. I had forgotten.
But, my original point is that it is probably better to specify the full
pathname of a command.
X=$(/bin/ls) will generally result in identical results as:
PATH=/bin:$(PATH)
X=$(ls)
But, specifying the full pathname also forces the command to be executed
Yes, but several Unix systems supply an old style Bourne SH as well as a
POSIX shell (essentially ksh scaled down) and ksh. KSH implemented the [[
as a way of internalizing the condition.
For the most part, the syntax will work in most Bourne derived shells.
if [ condition ]
then
#
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
At some point hitherto, Jerry Feldman hath spake thusly:
Actually, [ is a link to test. Linux uses a symlink, some Unixes use hard
links.
-rwxr-xr-x1 root root17496 Sep 20 2001 /usr/bin/test
lrwxrwxrwx1 root root
Benjamin Scott said:
If you are not interested in portability to older shells, here are some
optimizations:
math=$(( 1 + 1 )) # internal, easier, nestable
if [[ a = b ]]; ... # internal
I've had problems with [[ ]] on pdksh in the past. [ ] is
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
At some point hitherto, Tom Buskey hath spake thusly:
I've had problems with [[ ]] on pdksh in the past. [ ] is also
internal on modern unixen.
You can get the real ksh from David Korn's website. It's now freely
available, though I don't know
On Sun, 21 Apr 2002, Derek D. Martin wrote:
=-BEGIN PGP SIGNED MESSAGE-
=Hash: SHA1
=
=At some point hitherto, Tom Buskey hath spake thusly:
=
= I've had problems with [[ ]] on pdksh in the past. [ ] is also
= internal on modern unixen.
=
=You can get the real ksh from David Korn's
On Fri, 19 Apr 2002, at 5:25pm, Thomas M. Albright wrote:
it's the only way i know to add to variables:
today=`date +%j`
let tomorrow=$today+1
If you are not interested in portability to older shells, here are some
optimizations:
math=$(( 1 + 1 )) # internal,
11 matches
Mail list logo