|
Test script before actually running it
As I journey through learning more Linux & writing simple bash scripts to do everyday simple tasks I find myself intimidated sometimes by the unknown. Unknown being "what the heck is this script & or command really going to do?"
I've read in the past or at least that's what I interpreted that the "echo" command could be used in order to sample the output of a command before it's actually executed. Sometimes things need to be done with root privileges but I don't want to risk doing something stupid and irreversible to compromise my system.
How would this be done? A sort of dry run that will go through the command without actually executing it? I was looking at the "test" command but that doesn't seem to fit the bill or maybe I'm wrong.
|