Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: .profile Script Issue - command not found  (Read 10454 times)

0 Members and 1 Guest are viewing this topic.

ddavister

  • Guest
.profile Script Issue - command not found
« on: January 09, 2007, 09:06:50 AM »
In my .profile script on my Sun Solaris machines I use the following command to retrieve the host name into an environment variable:

HOST=`uname -n`

This works fine on Sun, but on my Linux machines I get the following message when the .profile runs and the variable is empty:

ksh: ./.profile[10]: uname: not found

What syntax changes do I need to make to get the same funcationality to work on Linux that works on Sun?

Linux Version:  2.4.21-47.ELsmp
Sun version: SunOS 5.8

Thanks!

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: .profile Script Issue - command not found
« Reply #1 on: January 10, 2007, 01:28:17 AM »
Try specifying the full path to uname (usually /bin/uname).  Or you can use /bin/hostname in place of "uname -n".
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos

ddavister

  • Guest
Re: .profile Script Issue - command not found
« Reply #2 on: January 10, 2007, 08:17:07 AM »
Fantastic, that worked.  Thank you.  It's always the little things.  I guess I was attempting to call those commands before the path had been established.

Rob Pomeroy



    Prodigy

  • Systems Architect
  • Thanked: 124
    • Me
  • Experience: Expert
  • OS: Other
Re: .profile Script Issue - command not found
« Reply #3 on: January 12, 2007, 03:56:13 AM »
No problem.  :)
Only able to visit the forums sporadically, sorry.

Geek & Dummy - honest news, reviews and howtos