18
4
I know there is a specific set of rules that shell expand the commands user typed. (let's talk about bash shell.)
Is it possible to print out a command in the form after shell expansion? It seems to be a good utility to learn and make sure how shell expands special characters.
e.g.
$ echo *
{all the filenames in current dir}
I want to print out the expanded command, which is the following line:
echo {all the filenames in .}
1This is what I do when testing a script – Barmar – 2015-01-06T03:00:30.983
This is still affected by other shell tokens
echo cat * | someprogram
doesn't do what you might think from this answer. – Kroltan – 2015-01-06T11:05:30.897