Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-28-2004, 12:56 PM   #1
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,


Old 11-28-2004, 01:18 PM   #2
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
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:
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'

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

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
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, 01:56 PM   #4
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?!


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 02:01 PM.
Old 11-28-2004, 02:01 PM   #5
Registered: Nov 2003
Location: Ronneby, Sweden
Posts: 555

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



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 01:10 PM
Unable to run post-Installation kickstart scripts zoulo Linux - Enterprise 0 07-05-2005 04:26 AM
Unable to execute sh scripts zowey Mandriva 2 12-23-2004 04:59 PM
Need help running scripts from scripts sdouble Linux - Newbie 3 05-31-2004 01:56 PM
Unable to logon on as non-root user after update as unable to set executable context pls198 Fedora 2 04-09-2004 12:41 PM > Forums > Linux Forums > Linux - Newbie

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

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