Go Back   The UNIX and Linux Forums > Operating Systems > Solaris


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-03-2012
Registered User
 
Join Date: Aug 2012
Location: Honolulu, HI
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
IFCONFIG is available... sort of

So, I have this script that makes a call to ifconfig to pull the interface information and report it. When I log on to the machine the script works just fine. But, if I'm on a remote machine and I make a call like this.

Code:
ssh user@server ./script.bash

I get an error saying that the IFCONFIG command is unavailable. No idea why.

Everything is being run as a user. Naturally, root ssh is disabled.
Sponsored Links
    #2  
Old 08-03-2012
Mead Rotor
 
Join Date: Aug 2005
Location: Saskatchewan
Posts: 16,400
Thanks: 492
Thanked 2,537 Times in 2,420 Posts
What, exactly, does it say?

It's probably just not in your PATH. See 'whereis ifconfig' to find out where it's hiding on that system.
Sponsored Links
    #3  
Old 08-03-2012
Registered User
 
Join Date: Aug 2012
Location: Honolulu, HI
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Corona688 View Post
What, exactly, does it say?

It's probably just not in your PATH. See 'whereis ifconfig' to find out where it's hiding on that system.


Code:
 
./sysinfo.bash: line 30: ifconfig: command not found

I also got the same error when I supplied the full path. I'd supply the script, but it's it's on a seperate network and I can't transfer the script to public domain.

The full path is /usr/sbin/ifconfig. And it runs fine if I do an actual login.

Last edited by Binary Buddha; 08-03-2012 at 05:44 PM.. Reason: forgot stuff
    #4  
Old 08-03-2012
Mead Rotor
 
Join Date: Aug 2005
Location: Saskatchewan
Posts: 16,400
Thanks: 492
Thanked 2,537 Times in 2,420 Posts
Quote:
Originally Posted by Binary Buddha View Post
I also got the same error when I supplied the full path.
Did you check the full path on the remote system, though? It might be a different full path on your remote system than your local one.
Quote:
The full path is /usr/sbin/ifconfig. And it runs fine if I do an actual login.
See, mine is /sbin/ifconfig. /usr/ seems a bit odd to me.
Sponsored Links
    #5  
Old 08-03-2012
Registered User
 
Join Date: Aug 2012
Location: Honolulu, HI
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Corona688 View Post
Did you check the full path on the remote system, though? It might be a different full path on your remote system than your local one. See, mine is /sbin/ifconfig. /usr/ seems a bit odd to me.
Yes, I did. I modified the script on the remote machine to point to /usr/sbin/ifconfig which is where it's located. I don't have whereis so I used which. Which is pretty much the same. It's Solaris 10 on a sparc Netra-T5220.
Sponsored Links
    #6  
Old 08-03-2012
Mead Rotor
 
Join Date: Aug 2005
Location: Saskatchewan
Posts: 16,400
Thanks: 492
Thanked 2,537 Times in 2,420 Posts
Well then, check for typos or special characters like carriage returns in the file.
Sponsored Links
    #7  
Old 08-03-2012
ɹǝsn sıɹɐlos
 
Join Date: Dec 2007
Location: Paris
Posts: 4,146
Thanks: 14
Thanked 401 Times in 369 Posts
Quote:
Originally Posted by Corona688 View Post
Did you check the full path on the remote system, though? It might be a different full path on your remote system than your local one. See, mine is /sbin/ifconfig. /usr/ seems a bit odd to me.
Older Solaris releases used to provide two different ifconfig binaries, one in /sbin and the other in /usr/sbin, with a slightly different behavior regarding the name service resolution order.
Recent releases have /usr/sbin/ifconfig being just a symbolic link to /sbin/ifconfig.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script to sort the files and append the extension .sort to the sorted version of the file pankaj80 UNIX for Advanced & Expert Users 3 06-07-2011 09:28 AM
not able to run ifconfig mail2sant Shell Programming and Scripting 3 12-07-2010 05:02 AM
ifconfig!!!! moco Shell Programming and Scripting 3 04-12-2007 08:22 AM
ifconfig Jariya OS X (Apple) 0 08-12-2005 06:10 AM
ifconfig breigner UNIX for Dummies Questions & Answers 7 04-16-2004 05:14 PM



All times are GMT -4. The time now is 09:20 AM.