Questions on shell execution


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Questions on shell execution
# 1  
Old 11-19-2007
Question Questions on shell execution

Hi,
I have a question regarding Korn shell script execution in HP-UX 11.11.

What sort of environmental settings do I need to run a Korn shell script such as below without entering "./" at the begining of the command?

Code:
cat test.ksh
date

I am able to do this with a user called infodba who is in dba group but it does not work when I use root user.

Cheers
Steve
# 2  
Old 11-19-2007
Hi , he best way to achieve that is modify your .profile, add the following line :

Code:
PATH=${PATH}:.

An be sure to export it.

Regards
# 3  
Old 11-19-2007
Thanx Klashxx.

I will try it and see how it goes.

Cheers
Steve
# 4  
Old 11-19-2007
I must point out that you increase your risk of an exploit if you modify the root PATH, particularly if you insert in front of the path rather than extending it. For instance, if you put the current-dir (".") in the front of the PATH, then any ordinary user can destroy the system by putting a "rm -fr /" inside a file called "/tmp/ls". If root ever cd's to /tmp and types "ls"...bang.

For security purposes, you should never put a directory in the root PATH that ordinary users have write-access to. Additionally, the root user should not rely on the PATH but rather use full pathnames (I realize this additional step is annoying, so adjust your paranoia level accordingly).
# 5  
Old 11-19-2007
I'll second that - do not have "." in your PATH - it's an accident waiting to happen.
And a decent sys admin will not allow it in root's PATH!
In fact, root shouldn't be running things that don't belong to root, anyway.
Thinking you ned root to run something usually just means you haven't thought through what is really required.
# 6  
Old 11-19-2007
Thank advice guys.

I will avoid modifying the root PATH and try finding a better method.

Steve
# 7  
Old 11-20-2007
Opps .. Steve i didn't notice that you wanted to use the root user. Sorry about that and tnx gus2000 & prowla.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execution of Shell Commands

I have a question: Where would I put the Command line (of any command) so that it executes every time I log on? Where would I put it if I want it to execute every time I start a new shell? (5 Replies)
Discussion started by: Nabeel Nazir
5 Replies

2. Shell Programming and Scripting

For loop like execution in shell

Hi, In the script that i work now, I wrote the script such a way that the values retrieved using a tcl script is passed into a shell script to specify the path where the specific file needs to be sourced exists. For eg: I got a path from the tcl script given below, ... (6 Replies)
Discussion started by: shivashankar_S
6 Replies

3. UNIX for Dummies Questions & Answers

shell script execution in ab initio

Hi All, How to execute shell script for running Ab initio graphs? Regards (0 Replies)
Discussion started by: eshalife
0 Replies

4. Shell Programming and Scripting

Shell execution

hi, Pls bare with me if this is trivial. Is it possible to run a korn shell with out specifying the name with its extensiion? Do i need to make any changes to the script make it work? Thanks (3 Replies)
Discussion started by: dvah
3 Replies

5. Shell Programming and Scripting

Shell scripting questions

I have a file like this. Pls help me to solve this. 08-24-2010 10:22:34,xxxxxxxxMessage : 111 08-24-2010 10:24:38,xxxxxxxbMessage : 000 08-24-2010 11:28:11,xxxxxxxcMessage : 111 08-24-2010 11:32:35,xxxxxxxdMessage : 111 08-24-2010 11:32:35,xxxxxxxeMessage : 111 (I should look for Message... (1 Reply)
Discussion started by: mnjx
1 Replies

6. Shell Programming and Scripting

Shell script questions

Hello. I am a beginner and I need to create a script that goes: There are several library where there are compressed files. I have to decompress all files that start with 'XA%' and retrieve all rows that contain 'CSSF' and copy this to a file. Can anyone help me? Thank you in advance :) (5 Replies)
Discussion started by: papou5480
5 Replies

7. Shell Programming and Scripting

automatic execution of shell script

Dear All, I want to execute a shell script,whlie system is booting. I was try using /etc/rc.d/rc.local file but its not working. (1 Reply)
Discussion started by: rajamohan
1 Replies

8. UNIX for Dummies Questions & Answers

Is there a way to tell how long does a shell script's execution take?

Is there a way to tell how long does a shell script(or a shell command)'s execution take? (4 Replies)
Discussion started by: meili100
4 Replies

9. Shell Programming and Scripting

Please help on shell scripts execution

I have already posted the question. Because previous post has sinked so that I have to ask the question again. I created the script and chmod it as 755. The ksh shell is in bin. Now I typed ./script_name.ksh to execute the script in the directory of that script. The return message was: Ksh:... (13 Replies)
Discussion started by: duke0001
13 Replies

10. Shell Programming and Scripting

execution of shell script

How can I execute another shell script from one? Malay (5 Replies)
Discussion started by: malaymaru
5 Replies
Login or Register to Ask a Question