- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Shell command SU destroys script execution
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2001 12:39 PM
10-30-2001 12:39 PM
Shell command SU destroys script execution
su - ecometry <
r=`ps -e | grep exe | grep -v grep | grep -v hello.exe`
if [ ! "$r" = "" ]
then
s=`echo "$r" | awk '{ print $1 }'`
for t in $s
do
echo $t
echo "- PID: $t has been echoed by the user."
done
fi
EO
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2001 12:47 PM
10-30-2001 12:47 PM
Re: Shell command SU destroys script execution
su - ecometry -c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2001 12:51 PM
10-30-2001 12:51 PM
Re: Shell command SU destroys script execution
There are several options:
1. just a check... has the user on all the systems you are planning to install the same UID and GID?
2 put the script in the fileset execute it from configure script and remove it .
3. put all the env settings you will need in the script PATH... etc. and exec an su command.
Hope this will give you some options.
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2001 01:06 PM
10-30-2001 01:06 PM
Re: Shell command SU destroys script execution
Unless you are 'root' the 'su' command will require a password to be entered from stdin (as the controlling terminal).
Regardless of this, add the '-c' option to your script as:
su - ecometry -c <
EOF
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2001 01:56 PM
10-30-2001 01:56 PM
Re: Shell command SU destroys script execution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2001 02:35 PM
10-30-2001 02:35 PM
Re: Shell command SU destroys script execution
Put all the contents between
EOF into a file and call
that file through
su - userid -c "filename"
Remember that the su - will
make the script inherit
the profile settings of
the userid .
HTH
raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2001 07:36 PM
10-30-2001 07:36 PM
Re: Shell command SU destroys script execution
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2001 07:48 PM
10-30-2001 07:48 PM
Re: Shell command SU destroys script execution
#!/usr/bin/ksh
Also, when you are troubleshooting the script, add the trace capability with the command:
set -x
The trace lines always go to stderr so if you want to page through the output, do something like this:
./myscript any-options 2>&1 | pg
Bill Hassell, sysadmin