I want to run watch
on a command which uses an optional command line argument, like this:
function queue() {
watch -n 10 'squeue -p ${1:-default} -o "%.8i" '
}
but the command-line argument isn't used, i.e. the default is only ever used. I tried escaping the $
as per this answer (e.g. watch -n 10 'squeue -p \${1:-default} -o "%.8i" '
), but that didn't work either.
Any help appreciated.