1984 – the techblog

(Hopefully) useful various sysadmin and other stuff.

August, 2011

Self-extracting shell scripts

Recently at work, I had to fig­ure out on how to trans­fer some data to sys­tems used by scripts that were exe­cuted directly on the hosts. It wasn’t that much pay­load, and I really didn’t want to be both­ered to set up a sep­a­rate filesys­tem place where to hosts rsync the data from, make sure […]

Bash: Preparing and executing commands in a variable/string

When writ­ing some shell scripts, one does often have command’s argu­ments and options pre­pared in a vari­able. Aside from the usual quo­ta­tion rules, this usu­ally works fine: > cmd=“ls –a” > $cmd . .. dir1 dir2 dir3 file1 file2 Don’t do this any­more. It only works eas­ily for sim­ple com­mands. As soon as you’ve got more complex […]