The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script works on Solaris, not on Linux Silverhood Shell Programming and Scripting 0 10-05-2007 09:27 AM
perl - how come this script works? mjays Shell Programming and Scripting 3 09-17-2007 10:50 AM
works from cmd-line but not in script OFFSIHR Shell Programming and Scripting 4 10-18-2006 08:41 AM
Script works fine until I | more Skovian Shell Programming and Scripting 2 01-11-2006 11:17 AM
Appending line with sed works on Linux but not on Solaris nir_s Shell Programming and Scripting 4 08-11-2005 03:00 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-05-2007
Silverhood Silverhood is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 2
Script works on Solaris, not on Linux

I'm in the same boat as Barbus - same exercis (Processes and Users)

The following script works on a solaris server I have access to. It doesn't however, work on the companies Linux machine. Any idea what's up? I have very little shell experience, and I can't seem to get this to work. Someting really obvious I'm missing that you vets can spot a mile off?

#!/bin/bash
#set -x

w | cut -d ' ' -f1 | sort -u | while read userID
do
while IFS=: read userIDpasswd junk junk junk userName junk
do
if [ "${userID}" = "${userIDpasswd}" ]; then
echo "userID->${userID} userName->${userName}"
ps -U ${userID}
fi;
done < /etc/passwd
done

Any help would be appreciated
  #2 (permalink)  
Old 10-05-2007
DukeNuke2's Avatar
DukeNuke2 DukeNuke2 is offline Forum Staff  
Soulman
  
 

Join Date: Jul 2006
Location: Germany, Berlin
Posts: 2,953
do
Code:
# w
on solaris and compare the output to linux... if there are any differences your script will not give the expected output...

Last edited by DukeNuke2; 10-05-2007 at 12:53 PM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:39 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0