lost standart input after su - <user>


 
Thread Tools Search this Thread
Operating Systems HP-UX lost standart input after su - <user>
# 1  
Old 06-14-2006
lost standart input after su - <user>

All,
hope somebody can help here:

wrote a small shell script running under root on //usr/bin/ksh
no specialisties in the profile.
Then the test script:
-------------------------------------------
echo "Now we start, press any key..."
read
su - test -c "id | wc -l" 2>/tmp/x
echo "DONE!!!"
read

--------------------------------------------
This script hangs after "echo DONE!!!"
I have to kill the shell to proceed. It works with:


-------------------------------------------
echo "Now we start, press any key..."
read
su - test -c "id" 2>/tmp/x
echo "DONE!!!"
read

--------------------------------------------

The pipe seems the problem. I the file /tmp/x I get then "Not a terminal"
the user "test" uses /usr/bin/ksh
Extract from /etc/passwd:
test:xxxxxxxxxx:105:20:,,,:/home/test:/usr/bin/ksh
Also a blank profile.

Can somebody verify / help?

Would be greatly appreceated.

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Red Hat

Converting Standart partition to LVM

is possible to convert standard partition ext4 to LVM with preserving data? is yes then how? OS is Linux 5 / 6 (1 Reply)
Discussion started by: manoj.solaris
1 Replies

2. Shell Programming and Scripting

User input and run awk using the input

I am trying to allow a user to enter in text and then store that text in a variable $gene to run in an awk command in which those values are used to run some calculations. I am getting syntax errors however, when I try. Thank you :). The awk runs great if it is a pre-defined file that is used,... (7 Replies)
Discussion started by: cmccabe
7 Replies

3. Shell Programming and Scripting

Script interacts with user , based on user input it operates

i have a script which takes input from user, if user gives either Y/y then it should continue, else it should quit by displaying user cancelled. #!/bin/sh echo " Enter your choice to continue y/Y OR n/N to quit " read A if then echo " user requested to continue " ##some commands... (7 Replies)
Discussion started by: only4satish
7 Replies

4. Shell Programming and Scripting

How to get the user input recursively until the user provides valid input

Hi, echo "Enter file name of input file list along with absolute path : " read inputFileList if then for string in `cat inputFileList` do echo $string done else echo " file does not exist" fi From the above code, if the user enters a invalid file... (1 Reply)
Discussion started by: i.srini89
1 Replies

5. Solaris

New user: lost application manager

Dear all, I am a beginner with Solaris. I unfortunately remove the Application Manager from the Front Panel, and I really don't know how to put it again, or from where launch it... Could anyone help me? (1 Reply)
Discussion started by: avr
1 Replies

6. Homework & Coursework Questions

brand new user!.. Lost on BASH script writing

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have just gotten into writing bash scripts for a class, part of the assignment is to read and be able to tell... (4 Replies)
Discussion started by: Byrang
4 Replies

7. UNIX for Dummies Questions & Answers

using `` ( standart output redirection ) in cshell

Hi everyone , I have a little question on using `` in cshell . I try to do the next thing : 1) I want to use a local varible of cshell script inside `` quotes , for example : set a = (find . | grep file $1 ) grep fff `perl -e 'some regular expression` $a ` the problem is when I... (2 Replies)
Discussion started by: khazin
2 Replies

8. UNIX for Dummies Questions & Answers

Hostname lost when changing user

Hello to all, Does anyone have a clue for the following problem? When I enter into a terminal console window logged as axadmin user, what I find in the prompt is: “axadmin@sunhost$”. But, when I switch to root user, with the command “su -“ and enter the correct password, user root is... (4 Replies)
Discussion started by: Pablo_BR
4 Replies
Login or Register to Ask a Question
pfexec(1)							   User Commands							 pfexec(1)

NAME
pfexec, pfsh, pfcsh, pfksh - execute a command in a profile SYNOPSIS
/usr/bin/pfexec command /usr/bin/pfexec -P privspec command [ arg ...] /usr/bin/pfsh [ options ] [ argument ...] /usr/bin/pfcsh [ options ] [ argument ...] /usr/bin/pfksh [ options ] [ argument ...] DESCRIPTION
The pfexec program is used to execute commands with the attributes specified by the user's profiles in the exec_attr(4) database. It is invoked by the profile shells, pfsh, pfcsh, and pfksh which are linked to the Bourne shell, C shell, and Korn shell, respectively. Profiles are searched in the order specified in the user's entry in the user_attr(4) database. If the same command appears in more than one profile, the profile shell uses the first matching entry. The second form, pfexec -P privspec, allows a user to obtain the additional privileges awarded to the user's profiles in prof_attr(4). The privileges specification on the commands line is parsed using priv_str_to_set(3C). The resulting privileges are intersected with the union of the privileges specified using the "privs" keyword in prof_attr(4) for all the user's profiles and added to the inheritable set before executing the command. USAGE
pfexec is used to execute commands with predefined process attributes, such as specific user or group IDs. Refer to the sh(1), csh(1), and ksh(1) man pages for complete usage descriptions of the profile shells. EXAMPLES
Example 1: Obtaining additional user privileges example% pfexec -P all chown user file This command runs chown user file with all privileges assigned to the current user, not necessarily all privileges. EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), ksh(1), profiles(1), sh(1), exec_attr(4), prof_attr(4), user_attr(4), attributes(5) SunOS 5.10 3 Mar 2003 pfexec(1)