user180574
user180574

Reputation: 6084

How to print Shell command literally?

In a shell script, is there a way to print command in this literal form after all variables are replaced with real value. For example, mkdir -p $HOME/src, before this command is executed, print something like mkdir -p /home/user/src. Thanks.

Upvotes: 0

Views: 64

Answers (1)

Guillem Cucurull
Guillem Cucurull

Reputation: 1691

Try set -x argument and check this

Upvotes: 2

Related Questions