). Copying large files (eg. virtual machine images) can take some time and without feedback you can just guess how much is still left. The dd command can print the desired progress, but it takes more than just a command line option to get there. Here's an example to make it print the progress every 10 seconds:dd if=input_file of=output_file bs=1M & pid=$! && while sleep 10 && kill -USR1 $pid 2> /dev/null; do :; done
sed in Darwin 9.4.0 (Mac OS X Leopard 10.5.4) lacks a lot of functionality.tar -cf - /some/file | ssh host.name tar -xf - -C /destination
echo) to this stream (file handle or whatever):echo "text" >&2myvar. How do you decide (in a safe way!) in a standard POSIX shell (or in the almost equivalent /bin/sh of the Debian distros) whether it contains a number or not? Sounds pretty much trivial, not? Here's what I came up with:mynumber=_
mynumber=$(($myvar)) 2> /dev/null
{ [ "$mynumber" = "_" ] && echo "Myvar is not a number."; } || echo "Myvar is a number."man command is our best friend.
But what to do if you've just downloaded something and want to read a manpage that was bundled within? Here's the command to use:groff -t -e -mandoc -Tascii filename | less
Recent comments
2 days 10 hours ago
2 days 10 hours ago
4 days 15 hours ago
1 week 1 day ago
1 week 2 days ago
1 week 3 days ago
1 week 3 days ago
1 week 3 days ago
1 week 5 days ago
2 weeks 16 hours ago