The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
problem with shell script execution anju Shell Programming and Scripting 2 05-08-2008 01:50 AM
Is there a way to tell how long does a shell script's execution take? meili100 UNIX for Dummies Questions & Answers 4 02-25-2008 07:49 AM
Please help on shell scripts execution duke0001 Shell Programming and Scripting 13 09-20-2006 03:31 PM
How to create file execution in KSH shell heru_90 Shell Programming and Scripting 4 06-23-2006 12:43 PM
execution of shell script malaymaru Shell Programming and Scripting 5 06-13-2005 09:49 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-19-2007
stevefox stevefox is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 114
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 (permalink)  
Old 11-19-2007
Klashxx's Avatar
Klashxx Klashxx is offline Forum Advisor  
HP-UX/Linux/Oracle
  
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 393
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 (permalink)  
Old 11-19-2007
stevefox stevefox is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 114
Thanx Klashxx.

I will try it and see how it goes.

Cheers
Steve
  #4 (permalink)  
Old 11-19-2007
gus2000 gus2000 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 157
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 (permalink)  
Old 11-19-2007
prowla prowla is offline
Read Only
  
 

Join Date: Nov 2007
Posts: 165
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 (permalink)  
Old 11-19-2007
stevefox stevefox is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 114
Thank advice guys.

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

Steve
  #7 (permalink)  
Old 11-20-2007
Klashxx's Avatar
Klashxx Klashxx is offline Forum Advisor  
HP-UX/Linux/Oracle
  
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 393
Opps .. Steve i didn't notice that you wanted to use the root user. Sorry about that and tnx gus2000 & prowla.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0