April 27, 2010, 7:59 pm
“:” is a little known Bourne Shell operator which is actually quite handy. However, like a alot of other short hand operators, its easy to forget, especially when its not used that much.
So what can it do?
- You can replace the true command with it, letting you write something like:
while :
do
some_commands
done
- Leave the then part of an if statement empty:
if :
then :
else :
fi
I agree, that example is probably useless for now, but amusing none the less.
So there you are! Next time you fancy steering from the norm of using true, you know what to do!
September 24, 2009, 6:49 pm
Its not as boring as you think, but you’ll HAVE to do it when you don’t have a windex file and want to search using man -k :
anton@opensolaris:/$ man -k grub
/usr/share/man/windex: No such file or directory
To get round this, we simply go ahead and create the index with catman:
anton@opensolaris:/$ pfexec time catman -w
real 2.9
user 1.8
sys 0.1
Its pretty quick, and you get left with a little index in /usr/share/man/windex. Its just an ascii version of all the names of your manpages, plus a one line summary of what each one does:
1 1 (3openssl) - OpenSSL configuration functions
1 1 (3openssl) - OpenSSL configuration functions
1394 ieee1394 (7d) - Solaris IEEE-1394 Architecture
2 2 (3openssl) - \& OpenSSL configuration cleanup functions
2 2 (3openssl) - \& OpenSSL configuration cleanup functions
2 2 (3openssl) - \& OpenSSL configuration cleanup functions
2.1 EasyTAG (1) - Tag editor for MP3 and Ogg Vorbis files
2_F32_Sat mlib_SignalConvertShift_U8_S8_Sat (3mlib) – data type convert
with shifting
5.0 MySQL (1) - MySQL RDBMS version 5.0 for Solaris
6to4 tun (7m) - tunneling STREAMS module
6to4relay 6to4relay (1m) - administer configuration for 6to4 relay router
communication
6to4tun tun (7m) - tunneling STREAMS module
7-Zip 7-Zip (1) - A file archiver with highest compression ratio
So now when you do your man -k , you’ll get something useful!:
anton@opensolaris:/$ man -k grub
bootadm bootadm (1m) - manage bootability of GRUB-enabled operating system
grub grub (5) - GRand Unified Bootloader software on Solaris
installgrub installgrub (1m) – install GRUB in a disk partition or a floppy
Crucially you only want to do catman -w , otherwise you’ll be reformatting all your manpages!
From the man page of catman:
-w Only create the windex database that is
used by whatis(1) and the man(1) -f and
-k options. No manual reformatting is
done.
June 3, 2008, 11:59 pm
Go visit goosh.org if you haven’t already. Maybe useful, maybe not. Its an interesting idea, basically something like a *nix shell but for the web. Interesting that you can even up key and it remembers your last command. Might be interesting if they expand it with some kind of scripting ability. Lets just hope its locked down and doesn’t turn into a real shell….or that people don’t mistake this shell for one they already have open….
rm -rf * ………………… “Hey, wheres the Internet gone?……..uh oh………”
Its definitely nice that there are no ads, making it quick to load (despite the fact that the results are heavily abbreviated compared to google.com)
Enjoy!