![]() |
|
|
|
|
|||||||
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sticky Bit???? | skyineyes | UNIX for Dummies Questions & Answers | 10 | 05-29-2008 10:15 AM |
| Sticky Bit | teenu18 | UNIX for Dummies Questions & Answers | 3 | 12-17-2007 11:08 AM |
| sticky bit | manu.vmr | Shell Programming and Scripting | 2 | 02-02-2007 03:43 AM |
| Sticky Bit | rob11g | UNIX for Dummies Questions & Answers | 1 | 03-14-2005 12:51 PM |
| Sticky bit | LivinFree | UNIX for Dummies Questions & Answers | 3 | 07-20-2001 08:28 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
I have a script that I want to be able to let user 'wcs1234' execute it, but when it runs, it will do so under the higher authority of 'cdunix'. It is my understanding that I accomplish this with a sticky bit. I have tried every variation of this but am unable to get this to work.
my script is as follows: !bin/ksh cd /opt/cmunix/teststage ls -lt # whoami print -n "enter file to copy....." read file echo $file " copied to stage directory.." # cp -p /opt/cmunix/teststage/$file /opt/cmunix/stage/ exit 0 my permissions are as follows: -rwxrwsr-x 1 cdunix sterling 511 Feb 04 15:41 cptostage.sh any help would be greatly appreciated.... Todd |
| Forum Sponsor | ||
|
|
|
|||
|
The checking for user bit is as per below:
SCRIPT_USER=wcs1234 WHOAMI=$(/usr/ucb/whoami) if [ "$WHOAMI" != "$SCRIPT_USER" ];then echo "$CallName: script must be run by $SCRIPT_USER" exit 1 else echo "You are $WHOAMI - OK to continue..." fi Not sure how to make this execute with another user though....but here's half to check the user.
__________________
Pete |
| Thread Tools | |
| Display Modes | |
|
|
|
The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
|
| 421 service not available, remote server has closed connection ^m autosys awk trim bash eval bash exec bash for loop command copy/move folder in unix couldn't set locale correctly curses.h cut command in unix daemon process export command in unix find grep find mtime find null character in a unix file grep multiple lines grep or grep recursive hp-ux ifconfig inaddr_any inappropriate ioctl for device lynx javascript mailx attachment mget mtime ping port remove first character from string in k shell replace space by comma , perl script scp recursive segmentation fault(coredump) sftp script snoop unix stale nfs file handle syn_sent tar exclude tar extract to folder test: argument expected unix unix .profile unix forum unix forums unix internals unix interview questions unix simulator unix.com vi select all vi substitute vi+substitute+end+of+line+character while loop within while loop shell script |