![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Couldn't set locale correctly | Mr Pink | SUN Solaris | 7 | 03-03-2009 08:16 AM |
| Secondary groups show in groups but don't show in id (Not working) | zen03 | HP-UX | 4 | 12-31-2007 11:15 AM |
| Variable not working correctly. | walsh_j | Shell Programming and Scripting | 3 | 05-30-2007 02:50 PM |
| if not working correctly | 2dumb | Shell Programming and Scripting | 3 | 05-03-2007 02:38 PM |
| HP-UX will not boot correctly | intern | UNIX for Dummies Questions & Answers | 5 | 05-24-2006 08:19 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Variable with $ do not show correctly
Hey guys i need help i have a script to push a password to a remote server the only problem is the $ENCRYPT variable has $'s in it (from the encrypted password in the shadow file) and they drop out when apending to the shadow file via the usermod command so
$1$Q/6a08n$EoAcBuR/YnoCQC shows up as /6a08noAcBuR/YnoCQC #!/bin/bash userid=${1} echo $userid SHADOW=/etc/shadow system=${2} SHADOWENTRY=`grep "${userid}" ${SHADOW}` echo ${SHADOWENTRY} ENCRYPT=`echo ${SHADOWENTRY} | awk -F: '{print $2}'` echo ${ENCRYPT} ssh $system /usr/sbin/usermod -p ${ENCRYPT} ${userid} Any help would be appreciated. Sean |
|
|||||
|
Here is a great resource written by Bruce Barnett
UNIX SHELL Quote Tutorial I think this will help you to understand how to avoid such problems |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|