LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Bash shell file... echo on? (https://www.linuxquestions.org/questions/linux-newbie-8/bash-shell-file-echo-on-648883/)

carlos_vcan 06-12-2008 02:13 PM

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...

colucix 06-12-2008 02:20 PM

Run the command with
Code:

bash -x
or put -x in the sha-bang, that is the first line of the script itself
Code:

#!/bin/bash -x

chrism01 06-12-2008 06:51 PM

See also the -v switch

i92guboj 06-12-2008 10:10 PM

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.


All times are GMT -5. The time now is 12:11 AM.