Op 31-08-17 om 16:43 schreef Nellis, Kenneth: > At the keyboard, it is inconvenient to type (e.g.): > shopt -s dotglob; mycmd; shopt -u dotglob
Try with a subshell. All it takes is a couple of parentheses. (shopt -s dotglob; mycmd) > But, I wonder if shopt might not itself accept a command to execute > with one-time shopt options in effect. The shopt command would have the same problem as your hypothetical wrapper function: globbing is resolved before the command is even invoked. - M.