How to use usrun command in shell script?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to use usrun command in shell script?
# 1  
Old 02-28-2014
Code How to use usrun command in shell script?

Hi All,

I am a newbie to shell scripting. I need to make a simple script

-which logs on to a server with usrun command
-Check some file listing at that location and come back where I was before.


Code:
usrun -h gbrpcr00076n06 utlanps
cd /home/apps/Mydir/
lst
exit

But after I run the script it executes usrun and stops...
It doesn't go to that path and give me the listing.. what should I change?

Last edited by CoolMohsin; 03-21-2014 at 11:26 AM..
# 2  
Old 02-28-2014
what is utlanps ?
# 3  
Old 02-28-2014
utlanps is a user name and my server name is gbrpcr00076n06
# 4  
Old 02-28-2014
nothing

Moderator's Comments:
Mod Comment User banned for creating and deleting all info posts.

Last edited by CoolMohsin; 03-21-2014 at 11:26 AM..
# 5  
Old 02-28-2014
Never used these command only know they are from Novell...
Code:
usrun -u utlanps -h gbrpcr00076n06 "(cd /home/apps/Mydir/;lst;exit)"

No guarantee... since I have nothing like to test...
The idea usrun expects as last argument a command so we try to show "a command" ...
Not sure you need the exit...
What does it produce?
# 6  
Old 03-01-2014
Thanks for your reply vbe

Last edited by CoolMohsin; 03-21-2014 at 11:26 AM..
# 7  
Old 03-24-2014
Moderator's Comments:
Mod Comment Note To Moderators: Please do not deleted posts or thread when users request them to be deleted. Thank you.



I have restored the first post in this thread.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shell script not working but command works in command prompt

Hi everyone I have a problem with my script If I try directly this command /usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz It works But if I simply add this command in a script and... (8 Replies)
Discussion started by: picemma
8 Replies

2. UNIX for Dummies Questions & Answers

Usrun command

What is the use of this command and do this command require passed ? ---------- Post updated at 05:28 PM ---------- Previous update was at 05:27 PM ---------- Password (2 Replies)
Discussion started by: sukesh31
2 Replies

3. Shell Programming and Scripting

Usrun

Hi Friends, can any one help me on making my one script. We are logging into AIX server through NPUM gateway and i am using this command in npum gateway usrun -h $servername root I am making script and want to store in NPUM server and in that script i am using this command usrun... (5 Replies)
Discussion started by: pallvi_mahajan
5 Replies

4. Shell Programming and Scripting

Unable to pass shell script variable to awk command in same shell script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies

5. Shell Programming and Scripting

When i am trying to execute export command within a shell script it is saying command not found.

I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found" My code is as follows: -------------------------- #!/bin/sh user="test" DIR="/bldtmp/"$user VIEW="test.view1" echo "TMPDIR before export... (4 Replies)
Discussion started by: dchoudhury
4 Replies

6. UNIX for Advanced & Expert Users

usrun command

Hi, I need to run usrun command and direct console output into a text file. eg: usrun -h <hostname> nobody The above example retunns "/bin/usrun: Permission denied" on the screen. I want this string to be directed into a text file. Please help me to achieve this. Any help in this... (2 Replies)
Discussion started by: MandyR
2 Replies

7. UNIX for Advanced & Expert Users

usrun command

Hi, I need to run usrun command and direct console output into a text file. eg: usrun -h <hostname> nobody The above example retunns /bin/usrun: Permission denied on the screen. I want this string to be directed into a text file. Please help me to achieve this. Any help in this... (4 Replies)
Discussion started by: MandyR
4 Replies

8. UNIX for Advanced & Expert Users

usrun command

Hi, I need to run usrun command and direct console output into a text file. eg: usrun -h <hostname> nobody The above example retunns "/bin/usrun: Permission denied" on the screen. I want this string to be directed into a text file. Please help me to achieve this. Any help in this regard... (2 Replies)
Discussion started by: MandyR
2 Replies

9. Shell Programming and Scripting

can anyone help with shell script command about searching word with grep command?

i want to search in the current directory all the files that contain one word for example "hello" i want to achieve it with the grep command but not with the grep * (2 Replies)
Discussion started by: aintour
2 Replies
Login or Register to Ask a Question