3 ms·
A more interesting command is /bin/[. Yep, it's the same as /bin/test, but basically requires the last argument to be a ]. Typically /bin/test and bin/[ are h
by metafunctor 10y ago
A more interesting command is /bin/[.
Yep, it's the same as /bin/test, but basically requires the last argument to be a ]. Typically /bin/test and bin/[ are hard links, that is, they are physically the same file and share the same inode(s).
You know, so you can type
if [ $foo = $bar ]; then
yes
else
exit
fi
This actually runs the command /bin/[, except most of the time it doesn't, because it's built-in to the shell.
As as side-note, an article like this should at least mention which OS and shell the author is using.
- Elrac 10y ago> As as side-note, an article like this should at least mention which OS and shell the author is using. Very much agree! I just tried this on my 2.6.32 RHEL system, and it's never heard of "-l". It outputs very similar-looking information as in the article, though, when given "-v" .