Mailing List Archive


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

Re: [tlug] The Mother of All (bash) Commands



Nguyen Vu Hung writes:
 > 2008/3/19, Josh Glover <jmglov@example.com>:
 > > So his point is that when *not* using GNU coreutils, ls(1) has very
 > >  few useful options.
 > To make the world utopia, the first thing when I get an Unix account is
 > installing latest GNU bash and coreutils.
 > 
 > Btw, in coreutils, true --help and true --version do show somethings.
 > Btw, what is the proper way to zero a file?

#!/usr/bin/env /bin/zsh
cat >temp.c <<EOT
int main (int argc, char *argv[]) {
int fd = open (argv[1],O_TRUNC,"w");
close (fd);
exit (0);
}
EOT
$CC temp.c
if ./a.out ${1:-/bin/bash}; then echo "Happy St. Patty's!"; fi
rm -f temp.c temp.o a.out

This is especially useful when called with no arguments. :-)


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links