LinuxQuestions.org
Register a domain and help support LQ
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 04-20-2005, 03:42 PM   #1
aw_wolfe
Member
 
Registered: Apr 2005
Posts: 50

Rep: Reputation: 15
Unhappy Command not found error - difference in shell?


What is the difference in running bash from gnome and running the shell using a different virtual shell (using function keys to get to text only) ?

Main problem/irritation is that I keep getting 'Command not found' when trying to run scripts/programs while in a Terminal under gnome that work perfectly fine when running under a virtual shell. I am assuming it has something to do with the environment paths or something. What is the problem? How can I fix it?

Thanks,

tony
 
Old 04-20-2005, 04:03 PM   #2
atom
Member
 
Registered: Feb 2004
Location: Slovenia
Distribution: archlinux
Posts: 271

Rep: Reputation: 31
Yeah, it does have to do with paths, namely the $PATH variable.

Go to an X-based terminal (the one in gnome) and type `echo $PATH`
now go to the F1 terminal and type the same thing. Compare the output, and post it here so we can see what gets sourced and what doesn't.

Good luck!
 
Old 04-20-2005, 04:07 PM   #3
Padma
Member
 
Registered: Aug 2003
Location: Omaha, NE, USA
Distribution: PCLinuxOS 2007
Posts: 808

Rep: Reputation: 30
There should be no difference.

If you open a terminal window in Gnome, it should read your .bash_profile and/olr your .basrhrc files to set up your environment. If you press CTRL-ALT-F2 to open a terminal session, it should read your .bash_profile and/or your .bashrc files to set up your environment.

The only thing I can think of is that somewhere (maybe even in /etc/bashrc) something looks to see if you are running inside a DE/WM, like gnome, and modifies your environment if that is or is not the case.
 
Old 04-20-2005, 04:56 PM   #4
aw_wolfe
Member
 
Registered: Apr 2005
Posts: 50

Original Poster
Rep: Reputation: 15
env

Here is the 2 dumps....

env (from gnome)
SSH_AGENT_PID=2997
HOSTNAME=localhost.localdomain
TERM=xterm
SHELL=/bin/bash
DESKTOP_STARTUP_ID=
HISTSIZE=1000
GTK_RC_FILES=/etc/gtk/gtkrc:/home/tony/.gtkrc-1.2-gnome2
WINDOWID=37748810
OLDPWD=/etc/sysconfig
USER=tony
LS_COLORS=no=00:fi=00:di=00;34:ln=00;36i=40;33:so=00;35:bd=40;33;01:cd=40;33;01r=01;05;37;41:mi= 01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00 ;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz =00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;3 5:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
SSH_AUTH_SOCK=/tmp/ssh-nJbICB2996/agent.2996
GNOME_KEYRING_SOCKET=/tmp/keyring-UYsjxC/socket
SESSION_MANAGER=local/localhost.localdomain:/tmp/.ICE-unix/2972
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/tony/bin
DESKTOP_SESSION=default
MAIL=/var/spool/mail/tony
PWD=/etc/sysconfig/network-scripts
INPUTRC=/etc/inputrc
LANG=en_US.UTF-8
GDMSESSION=default
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SHLVL=3
HOME=/root
GNOME_DESKTOP_SESSION_ID=Default
LOGNAME=tony
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-CZEvi2hoGd
LESSOPEN=|/usr/bin/lesspipe.sh %s
DISPLAY=:0.0
G_BROKEN_FILENAMES=1
XAUTHORITY=/root/.xauthwDJiga
COLORTERM=gnome-terminal
_=/usr/bin/env

****************************************
dump from virtual shell
HOSTNAME=localhost.localdomain
TERM=linux
SHELL=/bin/bash
HISTSIZE=1000
USER=root
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36i=40;33:so=01;35:bd=40;33;01:cd=40;33;01r=01;05;37;41:mi= 01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01 ;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz =01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;3 5:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
MAIL=/var/spool/mail/root
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
INPUTRC=/etc/inputrc
PWD=/root
LANG=en_US.UTF-8
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SHLVL=1
HOME=/root
LOGNAME=root
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
_=/bin/env

*************************

thanks for any help
 
Old 04-20-2005, 05:08 PM   #5
Padma
Member
 
Registered: Aug 2003
Location: Omaha, NE, USA
Distribution: PCLinuxOS 2007
Posts: 808

Rep: Reputation: 30
First difference I see is that you logged into your gnome terminal as you, but into the virtual shell as root. Two different users == two different $PATHs.
 
Old 04-20-2005, 05:09 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
One environment is for the user "tony" while the other is for the "root" user.

If you su to root use: su -
a second way is to run "bash -l" after su'ing to root. This will set up the root environment.
The "-l" option is for a login shell.
 
Old 04-20-2005, 05:49 PM   #7
aw_wolfe
Member
 
Registered: Apr 2005
Posts: 50

Original Poster
Rep: Reputation: 15
Smile got it thx

Ok, thanks. I had assumed that when I 'su' to root access that it would load that user's environment even if I originally logged into machine with my name.

Did not know about 'su -'

Thanks,

Tony
 
  


Reply


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
running shell script: command not found tripat Red Hat 3 04-14-2010 02:21 PM
Difference between Console, Shell, and Command Prompt Anupam Pathak Linux - Newbie 3 10-23-2005 05:40 AM
command not found error cdsnithi Linux - Software 2 07-06-2005 01:26 PM
command not found error lordshipmayhem Linux - Newbie 4 06-28-2005 10:15 PM
command not found (My shell script) Swift&Smart Linux - Software 3 05-16-2004 12:14 AM


All times are GMT -5. The time now is 09:10 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration