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
awk Shell Script error : "Syntax Error : `Split' unexpected Herry UNIX for Dummies Questions & Answers 2 03-17-2008 11:16 AM
syntax error ibroxy Shell Programming and Scripting 5 01-03-2008 08:03 AM
I got error like...syntax error on line 1, teletype koti_rama UNIX for Advanced & Expert Users 2 07-07-2007 07:35 PM
awk syntax error k@ssidy UNIX for Dummies Questions & Answers 12 06-15-2005 10:00 AM
Syntax error.. livetaurean19 Shell Programming and Scripting 0 06-14-2005 04:23 PM

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 07-02-2007
syndex syndex is offline
Registered User
  
 

Join Date: Jun 2007
Location: Pennsylvania
Posts: 46
Cool Usermod returning syntax error

"sudo usermod -d /home/${user1} -g $primgroup -Gn $grouplist -u $zaquid -p apple1 $user1"

What's wrong with this command?
  #2 (permalink)  
Old 07-02-2007
aigles's Avatar
aigles aigles is online now Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,416
Add a debug trace before the command and show us the output:

Code:
set -x
sudo usermod -d /home/${user1} -g $primgroup -Gn $grouplist -u $zaquid -p apple1 $user1
set +x
The option -Gn of the usermod command required a comma delimited list.
If you got the group list with the id command, this delimiter for that list is space.
Try to modifiy the id command :

Code:
id -GN user | sed 's/ \{1,\}/,/g'
  #3 (permalink)  
Old 07-02-2007
syndex syndex is offline
Registered User
  
 

Join Date: Jun 2007
Location: Pennsylvania
Posts: 46
Quote:
Originally Posted by aigles View Post
Add a debug trace before the command and show us the output:

Code:
set -x
sudo usermod -d /home/${user1} -g $primgroup -Gn $grouplist -u $zaquid -p apple1 $user1
set +x
The option -Gn of the usermod command required a comma delimited list.
If you got the group list with the id command, this delimiter for that list is space.
Try to modifiy the id command :

Code:
id -GN user | sed 's/ \{1,\}/,/g'

Here it is debugged:

+ ssh -q acce@comer sudo usermod -d /home/syncid -g staff -Gn staff -u 1231 -p xxx syncid
Usage: usermod [ -u uid ] [ -g group ] [ -G group1,group2 ... ] [-d dir [ -m ] ] [ -s shell ] [ -c comment ] [ -l new_name ] [ -e expire ] [ -r role1,role2 ... ] login

There is only one group under -Gn so I can't see that being the case.
  #4 (permalink)  
Old 07-02-2007
aigles's Avatar
aigles aigles is online now Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,416
Replace the option -Gn by -G
  #5 (permalink)  
Old 07-02-2007
syndex syndex is offline
Registered User
  
 

Join Date: Jun 2007
Location: Pennsylvania
Posts: 46
Quote:
Originally Posted by aigles View Post
Replace the option -Gn by -G
Still syntax error. Here is the debugged:

+ ssh -q x@x sudo usermod -d /home/syncid -g staff -G staff -u 1231 -p xxx syncid
Usage: usermod [ -u uid ] [ -g group ] [ -G group1,group2 ... ] [-d dir [ -m ] ] [ -s shell ] [ -c comment ] [ -l new_name ] [ -e expire ] [ -r role1,role2 ... ] login

Is it because the -g and the -G are the same?
  #6 (permalink)  
Old 07-02-2007
aigles's Avatar
aigles aigles is online now Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,416
The linux man page for the usermod commands doesn't signal restrictions.
Try to remove options one by one, to determine if one of them is source of the problem.
  #7 (permalink)  
Old 07-02-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,206
Quote:
Originally Posted by syndex View Post
Still syntax error. Here is the debugged:

+ ssh -q x@x sudo usermod -d /home/syncid -g staff -G staff -u 1231 -p xxx syncid
Usage: usermod [ -u uid ] [ -g group ] [ -G group1,group2 ... ] [-d dir [ -m ] ] [ -s shell ] [ -c comment ] [ -l new_name ] [ -e expire ] [ -r role1,role2 ... ] login

Is it because the -g and the -G are the same?
I don't see a -p option there.
Closed Thread

Bookmarks

Tags
linux, linux commands

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 02:14 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