Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

output shell commands to screen 1

Status
Not open for further replies.

Hondy

Technical User
Mar 3, 2003
864
GB
Hi

Can anyone tell me how to output the shell commands to the screen?

I have some script but they run silently, i want to be able to debug them so i'd like the commands to appear on screen as they are executed.

in windows I would use @echo on in the batch file, is there am equivalent in Linux shell?

Thanks
 
ok so it seems to be:
bash -v script.sh

It doesn't help me though! I'm getting command not found when the script tries to run a telnet command :S

my apache install is in usr/local/apache2, could it be it should be installed somewhere else?

Thanks
 
Have you tried echo "Now running line <whatever>" in your script? This will print the relevant info. to screen.

I want to be good, is that not enough?
 
ok Ken, I will try that.

Is it likely that I will get "command not found" if there isn't enough permissions to carry it out?

Thanks
 
apologies geirendre I never saw your post.

-x looks like a good solution. I can't try this until tomorrow now but can you tell me if this will do a step by step confirmation like you can do in a windows batch file?
 
geirendre - thanks for the link, bash -x script.sh was the one.

It turned out that the echo "words here";/ had a hidden space after the ;/ that caused it to return a " " and so a command not found. Nice one!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top