Download your favorite Linux distribution at LQ ISO.
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 12-04-2002, 12:05 AM   #1
LQ Newbie
Registered: Mar 2002
Location: united states
Distribution: Redhat 8.0 Gnome
Posts: 8

Rep: Reputation: 0
Question Programs from bash?

I would like to start using bash for everything. Is there a way to run all my programs from bash? If so, what are the commands to use? For example, while in gnome can i open the xterm and run mozilla?????
thanks for your help.....
Old 12-04-2002, 12:16 AM   #2
LQ Addict
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
why not? also try to put the jobs on background by appending &
It will give you bash prompt back when the program starts
Old 12-04-2002, 12:21 AM   #3
Senior Member
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 49
yeah. just type mozilla.
usually, the name of the application (mozilla, netscape, xine,
whatever) is the name of the binary executable you would need
to run. If said binary is in your path, then all you need to do is
enter its name.
Old 12-04-2002, 02:40 AM   #4
LQ Newbie
Registered: Dec 2002
Posts: 9

Rep: Reputation: 0

One thing to note is that you should make sure your paths are set correctly though. The standard program locations are /bin, /usr/bin, /usr/local/bin, /usr/X11R6/bin(I think can't remember the exact path), and quite often /opt/ProgramNameAndVersion/bin. If you don't have your path's set then you'll have to type the full location of the file ie: /usr/local/bin/mozilla &
Which as you can imagine even w/ tab completition can get tedious after a while. Hope the info is useful.


Old 12-04-2002, 04:38 AM   #5
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548
...and if you don't like to type "/usr/local/bin/mozilla &" each time, make it an alias in your ~/.bashrc:
alias moz='/usr/local/bin/mozilla &'
rerun your .bashrc and now you can type just "moz" to have it work.

Of course you can use "dialog" to script entire menus or use simple case statements in your .bashrc:

br_select() {
case "$1" in
ns4|netscape) /usr/local/bin/netscape &;;
moz|mozilla) etc, etc &;;
op6|opera|opera-6.1) etc, etc &;;
gal|galeon) etc, etc &;;
*|-h|--help) echo "browser: [ns(4|5)|mozilla|opera|galeon]"

alias browser='br_select $1'

Now you can type "browser ns4", while just typing "browser" or "browser -h" shows what's available.


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: how to get the PID of programs started? J_Szucs Programming 11 01-16-2012 03:08 AM
BASH - passing paramters to programs dkrysak Programming 1 11-18-2005 04:16 PM
launching programs from a bash script Ian D Linux - Software 2 10-25-2005 05:31 PM
Bash redirection being taken literally by programs R00ts Programming 13 05-26-2005 01:46 AM
problems running c programs in bash KDE4me Programming 10 05-01-2003 01:22 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:03 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