Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-12-2008, 03:13 PM   #1
LQ Newbie
Registered: May 2008
Posts: 4

Rep: Reputation: 0
Bash shell file... echo on?

I have been trying to create .sh files that actually show me what they are doing when executed.
If I remember accurately, in DOS there was the command "echo on" that activated the output to the screen. Is it possible to do this in linux?
I'd like to be able to click on a .sh file (KDE, Dolphin) and get a terminal window where all the commands run sequentially (windows .bat style)

I'd appreciate your suggestions...
Old 06-12-2008, 03:20 PM   #2
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Run the command with
bash -x
or put -x in the sha-bang, that is the first line of the script itself
#!/bin/bash -x
Old 06-12-2008, 07:51 PM   #3
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,418

Rep: Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398
See also the -v switch
Old 06-12-2008, 11:10 PM   #4
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,077

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Most desktops have also a small checkbox on the run dialogs that you can mark that says something like "Run application in a terminal".

By the way, this has nothing to do with the echo on/off functionality in DOS. What you are asking for is for an application to be launched into a terminal, which is a different thing. If you want to do that from your browser by just clicking on a given icon, you will need to change the associations for the script filetypes on the config of your desktop/file explorer, and add something like "xterm -e" in front of the actual command that is used to open that application.

In addition to that you might need to modify the scripts as people told you above.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH Shell Scripting -- foreach file in folder??? AC97Conquerer Programming 11 07-06-2011 01:25 AM
File Creation: bash shell stapletone Linux - Newbie 2 09-24-2006 01:35 PM
end of file in bash shell manojg Linux - Newbie 4 03-09-2006 11:11 AM
bash:output file names from shell script to vi sickboy Linux - Newbie 6 10-14-2004 04:40 AM
systemwide bash login shell cleanup file markus1982 Linux - General 2 05-10-2003 09:35 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:50 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration