LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 06-12-2008, 02:13 PM   #1
carlos_vcan
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, 02:20 PM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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
 
Old 06-12-2008, 06:51 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

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

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
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.
 
  


Reply



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 12:25 AM
File Creation: bash shell stapletone Linux - Newbie 2 09-24-2006 12:35 PM
end of file in bash shell manojg Linux - Newbie 4 03-09-2006 10:11 AM
bash:output file names from shell script to vi sickboy Linux - Newbie 6 10-14-2004 03:40 AM
systemwide bash login shell cleanup file markus1982 Linux - General 2 05-10-2003 08:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:23 AM.

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