-
linux script
#!/bin/ksh
user1=`who am i|awk '{ print $1 }'`
echo $user1
==================
above is my script
This works from prompt
however it does not work from cron
please help
-
Originally Posted by rjnlinux
#!/bin/ksh
user1=`who am i|awk '{ print $1 }'`
echo $user1
==================
above is my script
This works from prompt
however it does not work from cron
please help
the solution is as follows
create a file which has variables I require
source this file in the script
Now the script works from cron as required
Enjoy !!
-
You can also implement this by placing the variables in the function, it will give you an opportunity to bring them anywhere.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|