Quick question:

Anyone know if Bash has a variable to hold the command line args before they were expanded?

If I type myscript *, $@ holds the expanded list. Is there a variable that holds the '*'?

#Linux #Bash

@c64whiz

(That answer is irrelevant now, it was meant to answer the myscript \* question which turned out to be a typo)

No, that's actually not what happens: if you escape the asterisk, it is passed to the process as-is. It is just expanded when you use it.

See the difference of echo $@ vs. echo "$@"

@c64whiz And no, there is no way to get the parameter list before expansion from your sub-process. That information simply doesn't exist. When you call some command from your shell, the shell does parameter expansion and creates the commandline for the sub-process it spawns, and that can only see its commandline, not what you actually typed into your shell.