On 2021/08/14 17:05, Kerin Millar wrote:
On Sat, 14 Aug 2021 15:59:38 -0700
George Nachman <gnach...@llamas.org> wrote:

This does not constitute a valid test case for two reasons. Firstly, aliases have no effect in scripts unless the expand_aliases shell option is set.
----
1)  I frequently use for loops in an interactive shell to act on arrays.
   Arrays are the easiest way to not have spaces breaking args
i.e.:
2)  I almost always start my scripts with a templated prologue:
----
 cat ~/bash/template
#!/bin/bash -u
# vim=:SetNumberAndWidth
export PS4='>${BASH_SOURCE:+${BASH_SOURCE/$HOME/\~}}#\
${LINENO}${FUNCNAME:+(${FUNCNAME})}> '
shopt -s expand_aliases
alias my='declare ' int='my -i ' array='my -a ' map='my -A '
setx() { trap unsetx EXIT; set -x; } ; unsetx() { set +x;}
################################################################################
## (prog goes here)
# vim: ts=2 sw=2
----




Reply via email to