LinuxQuestions.org
Review your favorite Linux distribution.
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 03-01-2011, 09:49 AM   #1
ManiacBlaster
LQ Newbie
 
Registered: Mar 2011
Location: Iowa City
Posts: 3

Rep: Reputation: 0
"Command not found" for all but pwd and echo, PATH is empty


I logged into my Red Hat Enterprise Linux machine at work (use it for software development) and the primary GUI does not load. Instead, widgets appeared for xclock, xterm, and Firefox. In the terminal, I start typing in commands to try to figure out what's going on, but all commands are not found except pwd and echo. I 'echo $PATH' and that returns just an empty, blank line. 'echo $SHELL' lets me know I'm using cash.

The likely cause was my attempt to install Adobe Reader Firefox plugin yesterday. After it downloaded, I ran the binary but Firefox didn't seem to recognize that I had installed it, so I went into my .cshrc file and added the adobe folder to the path. That didn't seem to work, so I gave up, deleted the binary and the folder I installed to, and removed that directory from the path in the .cshrc file. This last thing (the export PATH line in that file) I'm certain is back exactly as it was before.

I have successfully added the /bin and /usr/bin back to the path from command line via

setenv PATH /usr/bin:/bin

but of course it doesn't stick after reboot nor does it magically load the primary GUI.

Any help would be awesome. I'd rather not go through the effort of creating a ticket for our company's Global Service Desk cuz there's no telling how long that could take to resolve. In the meantime, I can't do any programming.
 
Old 03-01-2011, 10:28 AM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
pwd and echo are probably shell builtin commands--there is no need to launch an external program.

The PATH environment variable is simply a shortcut. You can launch other programs directly by using the absolute path. So all you need to do is give the full path to your editor to fix your .cshrc file.

There's no rule against guessing. Assuming you like emacs, try /bin/emacs, or /usr/bin/emacs at the command line. If you don't want to guess, ask a coworker to tell you what the absolute path is to the editor. All they have to do is which emacs or similar.

Once you have your .cshrc open, then I would bet one or two things happened:
1. You had a typo in the new PATH assignment that killed the previous assignment
2. Your attempt to delete the added path deleted too much.

If the problem isn't obvious to fix, you should post the contents here--you should be able to copy-paste between the editor window/terminal and the firefox window.
 
Old 03-01-2011, 10:45 AM   #3
ManiacBlaster
LQ Newbie
 
Registered: Mar 2011
Location: Iowa City
Posts: 3

Original Poster
Rep: Reputation: 0
Yeah, I was able to check out the file using vi. I'm very sure there's no typo or anything missing, but then again newbies have a tendency to be sure of such things. I'll post it for you to look at. Also, is there a tag I should use when copying code into a reply?

#
# ======================================================================
#
# Default user .cshrc file (/bin/csh initialization).
#
# ======================================================================
#
###########################################################################
#
# ********************************************************
# ********** DO NOT MODIFY THIS SECTION **********
# ********************************************************
#
# If you encounter any problems, this file will be over written.
# Your modified file will be moved to a different name and the network
# defaults will be copied in place.
#
# The start of this file contains lines necessary for you to get a basic
# configuration for this network and for troubleshooting purposes.
#

set DOMAIN=`domainname`
if ( -r /opt/collins/.cshrc ) then
source /opt/collins/.cshrc
endif
#exit #do not remove -- used for debugging

###########################################################################
#
# Check the following directory for any project specific application startup scripts
#
###########################################################################

if ( -d ~/.setup ) then
foreach file ( ~/.setup/* )
source $file
end
endif
#exit # Do not remove - for debugging purposes

###########################################################################
#
# *********************************************************************
# ********** Place your personal customizations here **********
# *********************************************************************
#
# NOTE: If it is determined that any customizations you have made to this
# file may be causing any problems that arise, it WILL be moved and
# the network defaults will be copied in it place. Please edit
# this file with extreme care and knowledge.
#
# It is assumed csh is the shell being used. If you are using tcsh or any
# other unsupported derivative shell, modify this to fit your rc file
#

# IF NON-INTERACTIVE SHELL, SKIP THE FOLLOWING TO SPEED UP THE LOGIN/SHELL
# CREATION. UNIX POWER TOOLS 2.09

echo "Sourcing shhconfig.cshrc"
source /usr/lfs/v0/environment/shhconfig.cshrc
echo "Sourcing shhconfig.login"
source /usr/lfs/v0/environment/shhconfig.login


alias setprompt 'set prompt="\[`id -nu`@`hostname -s``pwd`)\]\# " '

#alias cd 'cd \!*;echo $cwd'
alias cd 'cd \!*; setprompt'
alias v0 'cd /usr/lfs/v0'
alias Nokia 'cd /usr/lfs/v0/Nokia'
alias cp 'cp -i'
alias mv 'mv -i'
alias rm 'rm -i'
alias pwd 'echo $cwd'
set noclobber
set savehist=100
set history=100
set filec
limit coredumpsize 0

if ($?prompt) then
set USER = $LOGNAME
set system = `hostname` # name of this system.
#set prompt = "`hostname|cut -d. -f1`_`uname`_$USER> "
set prompt = "`hostname|cut -d. -f1`_`uname`_$USER `pwd`> "
limit coredumpsize 0
set notify
endif

setenv WR_LAYERS /opt/WindRiver/wrlinux-3.0/layers/wrll-toolchain-4.3-85/arm/toolchain/x86-linux2/bin
setenv WR_SYSROOT /opt/WindRiver/wrlinux-3.0/sysroots/arm_versatile_926ejs-glibc_std/x86-linux2
setenv SDK_ARM_PATH /usr/lfs/v0/Nokia/SDK_arm

setenv PATH
/usr/lib:${WR_LAYERS}:${WR_SYSROOT}:${SDK_ARM_PATH}:$PATH
 
Old 03-01-2011, 11:32 AM   #4
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 112Reputation: 112
Is that a carriage return after "setenv PATH"? That needs to be a single line.
 
Old 03-01-2011, 11:40 AM   #5
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Quote:
Originally Posted by SL00b
Is that a carriage return after "setenv PATH"? That needs to be a single line.
My thoughts exactly. I couldn't tell if it was the forum wrapping a long line or if there was a hard carriage return. I maximized my browser window, and the line still spears to be split across two lines. It should all be the same line, as in:
Code:
setenv PATH /usr/lib:${WR_LAYERS}:${WR_SYSROOT}:${SDK_ARM_PATH}:$PATH


Quote:
Originally Posted by ManiacBlaster
Also, is there a tag I should use when copying code into a reply?
Yeah, to make the code appear monospaced, use [code] ... [/code] tags.
 
Old 03-01-2011, 11:45 AM   #6
ManiacBlaster
LQ Newbie
 
Registered: Mar 2011
Location: Iowa City
Posts: 3

Original Poster
Rep: Reputation: 0
Oh man! I feel so stupid for not noticing that. It works again. Thanks!
 
  


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
[SOLVED] Errors executing shell script: "command not found" and "no such file or directory" eko000 Linux - Newbie 1 01-14-2011 07:54 AM
Newbie - OSX "command not found" Path issue Pinball2k Other *NIX 11 10-19-2008 04:00 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
want full description of "echo num > / path/...." zameer_india Linux - Newbie 5 01-08-2005 03:10 AM

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

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