LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-28-2004, 11:56 AM   #1
Aziz
LQ Newbie
 
Registered: Sep 2004
Location: USA
Distribution: Fedora Core 3
Posts: 29

Rep: Reputation: 15
Unhappy Unable to excute scripts


My fedora default script was bash....

The only way I can run files is by the DOT method #> . script

I can not do it by the name method, just the name (chomoed to 777).

I am suppose to use the korn shell and the korn shell will NOT accept both methods, when I try the dot method it says:

ksh : file: not found

anyone has an idea on whats wrong?!

also does anyone know how to change the deafult shell in fedora?

I appreciate any answer,

Peace,

 
Old 11-28-2004, 12:18 PM   #2
MartinN
Member
 
Registered: Nov 2003
Location: Ronneby, Sweden
Posts: 555

Rep: Reputation: 30
Hi Aziz

I don't follow you, I'm afraid. If you want to run a scipt file (or any other executable from the current directory) then you'll have to type
./name_of_executable
The reason is that '.' (DOT, current directory) is not part of the search path for executables. It's generally considered a bad idea to have current directory in the search path for executables, since it means that you may run different programs depending on current directory. The root user should definitely NOT have current directory in his/her path.

If you really think that you want it anyway, put these commands in your .bash_profile file:
Code:
PATH=$PATH:.
export PATH
This adds current directory to the end of the search path. (This solution probably looks different in some other shell, though.)

To change default shell in Fedora; from the start menu, select 'System Settings > Users and Groups'

Martin
 
Old 11-28-2004, 12:27 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
If a script is in the current directory, you should be able to run it like ./script-name. The reason is that the current directory isn't in the default path for security reasons.

You may need to install the package that contains the korn shell. On mandrake linux it is in the pdksh package. Try the rpmseek site to find it for fedora.
 
Old 11-28-2004, 12:56 PM   #4
Aziz
LQ Newbie
 
Registered: Sep 2004
Location: USA
Distribution: Fedora Core 3
Posts: 29

Original Poster
Rep: Reputation: 15
Thanks martinm and jschiwal for the answer..

I understand what to do now, I changed the the login shell, but whenever I try to run a file you guys said:

$ ./ ht2
ksh: ./: cannot execute - Is a directory

What does that mean?!

Peace,

EDIT: THe mistake was that I made a space between the filename and ./

now it works

Thnx alot guys

Last edited by Aziz; 11-28-2004 at 01:01 PM.
 
Old 11-28-2004, 01:01 PM   #5
MartinN
Member
 
Registered: Nov 2003
Location: Ronneby, Sweden
Posts: 555

Rep: Reputation: 30
There shouldn't be a space between ./ and ht2

Martin
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VPN: Debian Scripts -> Mandriva 2006 Scripts Undefined Mandriva 0 11-30-2005 12:10 PM
Unable to run post-Installation kickstart scripts zoulo Linux - Enterprise 0 07-05-2005 03:26 AM
Unable to execute sh scripts zowey Mandriva 2 12-23-2004 03:59 PM
Need help running scripts from scripts sdouble Linux - Newbie 3 05-31-2004 12:56 PM
Unable to logon on as non-root user after update as unable to set executable context pls198 Fedora 2 04-09-2004 11:41 AM


All times are GMT -5. The time now is 09:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration