You are not logged in.

#1 2008-01-10 19:35:26

underpenguin
Member
Registered: 2007-02-01
Posts: 116

Wierd....$PATH Screwed up [SOLVED].

Hi,
I got up this morning (err...afternoon) to find that my netcfg2 command resulted in "command not found" etc. After some looking around, i saw that my $PATH variable had only a few entries, and was ended with a "." I've added a few back, but I want to know what caused this and how I can fix it. Also, I added some stuff like /usr/bin, /usr/sbin, but I can't find where ifconfig lives. Can someone let me know, or better yet give me a command to find it (looking for a file named x and printing out the path(s)). Thank you

Last edited by underpenguin (2008-01-11 05:12:16)

Offline

#2 2008-01-10 19:39:23

peart
Member
From: Kanuckistan
Registered: 2003-07-28
Posts: 510

Re: Wierd....$PATH Screwed up [SOLVED].

ifconfig is in /sbin.  You can find it with "find / -name ifconfig", although there might be a better way.  Finding stuff from / can take a while.

Offline

#3 2008-01-10 19:43:03

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Wierd....$PATH Screwed up [SOLVED].

$ sudo updatedb
$ locate ifconfig

Offline

#4 2008-01-10 19:52:45

underpenguin
Member
Registered: 2007-02-01
Posts: 116

Re: Wierd....$PATH Screwed up [SOLVED].

Thanks,

Anyone know what caused the problem / permanent solution besides adding & exporting to PATH every time I boot?

Offline

#5 2008-01-10 20:22:17

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Wierd....$PATH Screwed up [SOLVED].

look in your ~/.bashrc ~/.bash_profile to see if any of those are setting your path

Offline

#6 2008-01-10 20:36:29

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Wierd....$PATH Screwed up [SOLVED].

To find executables, there's also "whereis ifconfig"

Offline

#7 2008-01-10 21:23:16

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Wierd....$PATH Screwed up [SOLVED].

Did you delete /etc/profile?

Offline

#8 2008-01-11 03:43:24

underpenguin
Member
Registered: 2007-02-01
Posts: 116

Re: Wierd....$PATH Screwed up [SOLVED].

I may have, is there supposed to be a file called /etc/profile  ? I have a folder /etc/profile.d/ and a /etc/bash.profile  Can someone post theirs so i have something to work off of if this indeed is the problem?

Thank you

Offline

#9 2008-01-11 04:29:49

synorgy
Member
From: $HOME
Registered: 2005-07-11
Posts: 272
Website

Re: Wierd....$PATH Screwed up [SOLVED].

Contents of my /etc/profile

#
# /etc/profile
#
export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/opt/bin"

export MANPATH="/usr/man:/usr/X11R6/man"
export LESSCHARSET="latin1"
export INPUTRC="/etc/inputrc"
export LESS="-R"

export LC_COLLATE="C"

export COLUMNS LINES

export PS1='[\u@\h \W]\$ '
export PS2='> '

umask 022

if [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" -o "$TERM" = "rxvt" -o "$TERM" = "xterm-xfree86" ]; then
  PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
fi

# load profiles from /etc/profile.d
#  (to disable a profile, just remove execute permission on it)
if [ `ls -A1 /etc/profile.d/ | wc -l` -gt 0 ]; then
  for profile in /etc/profile.d/*.sh; do
    if [ -x $profile ]; then
      . $profile
    fi
  done
  unset profile
fi

#End of File

"Unix is basically a simple operating system, but you have to be a genius to understand the simplicity." (Dennis Ritchie)

Offline

#10 2008-01-11 05:11:55

underpenguin
Member
Registered: 2007-02-01
Posts: 116

Re: Wierd....$PATH Screwed up [SOLVED].

Thanks very much synorgy for your profile and phrakture for your (as usual) uncanny ability to fix everything. [SOLVED]!

Offline

Board footer

Powered by FluxBB