![]() |
|
|
|
|
|||||||
| SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems . |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do i change to super user then revert back to ordinary user ,using shell script? | wrapster | Shell Programming and Scripting | 3 | 06-04-2008 04:11 AM |
| Script using awk works only as super user | gjithin | Shell Programming and Scripting | 10 | 05-09-2008 06:30 AM |
| Shell Script: want to insert values in database when update script runs | ring | Shell Programming and Scripting | 1 | 10-25-2007 12:06 AM |
| What user runs cron? | michieka | UNIX for Dummies Questions & Answers | 10 | 06-02-2002 07:32 PM |
| FTP as Super User | fbavent | UNIX for Dummies Questions & Answers | 3 | 05-22-2002 08:49 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Sunsolaris shell script runs only as super user
Hi Friends,
I am new to Sun solaris unix.I am facing problem while runing my kornshell script just as an ordinary user.The script works fine while i am working as a super user.the script just uses awk to check the first charcter of a file and then copies the file to another folder. Do i need to change any enviornment variable. Please help Jithin.G |
| Forum Sponsor | ||
|
|
|
|||
|
What error messages do you get?
Post your script. Are you sure you (as normal user) have the rights to read this file ans write to the other folder? What do "ls -l your_file" and "ls -ld your_folder" say? |
|
|||
|
my script is
line=$(awk '{if(substr($0,1,1)!="#" && substr($0,1,1)!=";" && substr($0,1,1)!=" " && substr($0,1,1)!="/" && substr($0,1,1)!="*" && substr($0,1,1)!="\\" && length($0)!=0) {print $0} }' filename This works fine when i login as super user but it does not work with other user and show error. I am still geting the error ....ksh[line]: awk: not found ls -l file name gives -rwxrwxrwx 1 jithin other 38388 date filename ls -ld folder gives drwxrwxrwx 2 jithin other 512 date foldername |
|
|||
|
pretty obvious:
Code:
ksh[line]: awk: not found |
|
|||
|
$PATH in super user has another component /usr/sbin
But which awk in both super user and user gives /usr/bin I tried to change $PATH in *.profile file of user .it changes in file . But then again i checked the echo $PATH it shows the same earlier result. |
|||
| Google UNIX.COM |