Problem with /etc/profile?

Forum rules
Before you post please read how to get help
Level 1
Level 1
Posts: 38
Joined: Tue Apr 27, 2010 5:02 pm

Problem with /etc/profile?

Postby unkilbeeg » Tue Aug 09, 2011 7:21 pm

I'm not sure if this is the right place for this, but it seemed at least sort of appropriate.

I just installed LMDE on a workstation, and I've managed to get it updated to current. As part of my configuration routine, I went to another workstation so I could SSH in and do some copy and paste on setting up the new machine.

I noticed that each time I logged in remotely, the following message showed up:

Code: Select all

-bash: id: command not found
-bash: [: : integer expression expected

After lots of digging around I noticed that /etc/profile begins like this:

Code: Select all

if [ "`id -u`" -eq 0 ]; then
export PATH

The "id" command is issued before the PATH is set, so that seems to fail. I replaced that first line with

Code: Select all

if [ "`/usr/bin/id -u`" -eq 0 ]; then

and the problem seems to have gone away.

Has anyone else seen this?

User avatar
Level 24
Level 24
Posts: 21281
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Problem with /etc/profile?

Postby xenopeek » Wed Aug 10, 2011 2:19 am

I haven't used SSH, so no comment on the error. But the /etc/profile on my setup has the same code.

BTW you should really not login as root over SSH :D This id -u check is to see if you are logged in as root.

Return to “Scripts & Bash”

Who is online

Users browsing this forum: No registered users and 3 guests