Solved

Have command print to the screen during execution

Posted on 2014-04-06
3
504 Views
Last Modified: 2014-04-06
In RHEL, how do you get commands contained within a script to print to the screen, instead of just the output of the commands
0
Comment
Question by:Anthony Lucia
3 Comments
 
LVL 34

Assisted Solution

by:Dan Craciun
Dan Craciun earned 250 total points
ID: 39981673
cat script.name

Open in new window

HTH,
Dan
0
 
LVL 20

Accepted Solution

by:
edster9999 earned 250 total points
ID: 39981678
That will show the contents of the script at the start.
If you would like to show each line as it runs do

bash -x script-name

(the -x bit means show each command just before running it)
0
 
LVL 48

Expert Comment

by:Tintin
ID: 39981924
Another way is to run the script without executing the commands, ie:

bash -nv script
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question