SUMMARY: changing someone's home directory using nistbladm

From: Steve Plemmons (plemmons@math.msu.edu)
Date: Thu Jan 15 2004 - 14:14:15 EST


Back in July, Dave Martini posted the following syntax as the proper way to
use nistbladm to edit the value of a table (why are the sun docs so off on
this?).

 

 
nistbladm -e value=hostname:/export/home2/user
'[key=username]'auto_home.org_dir
 
I translated that into the following command for my needs:
 
nistbladm -e home=/home/faculty2/brenden '[name=brenden]'passwd.org_dir
 
This works fine from the command line, but I wanted to script this to save
some typing. Following is the text from a simple example of what I want to
do:
 
#!/bin/sh
 
echo "Enter login name: "
read USERID
MAT=`nismatch name=$USERID passwd.org_dir`
if [ -z "$MAT" ]; then
   echo no such user $USERID
   exit 1
fi
nistbladm -e home=/home/faculty/${USERID} '[name=${USERID}]'passwd.org_dir
 
Running this script gives me the following output.
 
Enter login name:
brenden
can't modify entry: Not found.
 
 
I know that this is a simple scripting problem with the variable usage or
maybe something to do with the single quotes, but I can't find the answer in
any docs that I have available to me or on the net. Can someone give me
some advice about the proper syntax for that last line of my script?
 
Thanks,
 
Steve Plemmons
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:27:50 EDT