development:scripts:start
Table of Contents
Scripts
Shell
Links
How to "source" an environment for a command
$SHELL -c "( source env-of-cmd.sh ; $* )"
How to "daemonize" a script
if [ "x$1" != "x--" ]; then echo "restarting as daemon..." $0 -- & exit 0 fi # stuff to do
Compare two directory listings (regarding names and size)
ls -lL <path/to/dir1> | sed -e 's/ [ ]*/ /g' | cut -d ' ' -f '5,9-' | sort -k 2 > dir1.lst ls -lL <path/to/dir2> | sed -e 's/ [ ]*/ /g' | cut -d ' ' -f '5,9-' | sort -k 2 > dir2.lst diff dir1.lst dir2.lst
SED
Squeeze multiple spaces to single
sed -e 's/ [ ]*/ /g'
development/scripts/start.txt · Last modified: 2022/08/29 07:26 by 127.0.0.1