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 02-13-2017, 08:54 PM   #1
killingthemonkey
Member
 
Registered: Mar 2011
Location: Winston-Salem, NC
Distribution: Fedora, CentOS, Linux Mint
Posts: 181

Rep: Reputation: 19
RHEL 7, Korn Shell, Unable to Source my .kshrc


I just switched from BASH to KSH. I've been back and forth between them. I'm changing due to Korn being the default AIX shell and if I get the position I want, I'll be working on AIX as well as RedHat and Suse.

Here's my home directory:
Code:
rllt1sdk:home/xxxxxx/$: ls -a
.	       .dbus	  .gnome	   .mozilla	.vim
..	       Desktop	  .gnome2	   .pki		.viminfo
.bash_history  Documents  .gnome2_private  .profile	.vimrc
.bashrc        Downloads  .kshrc	   .sh_history	.Xauthority
.cache	       .emacs.d   .lesshst	   User-Admin	xinetd.conf
.config        .esd_auth  .local	   Users.txt
Here's my "name -a":
Code:
Linux rllt1sdk.xxxxxxxxxxxx.com 3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 9 10:09:10 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
As you can see, I have a ".kshrc" in the directory. I just edited it. So, I try to source it with the command ". .kshrc"

I receive the error:
Code:
-ksh: .: .kshrc: cannot open [No such file or directory]
Thanks for your help,
Doug

Last edited by killingthemonkey; 02-13-2017 at 09:07 PM.
 
Old 02-13-2017, 09:22 PM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
what do the file permissions look like? You didn't say accidentally create it with root privs and forgot to chown it? Also do you have selinux enabled, could be due to that if so.

Last edited by r3sistance; 02-13-2017 at 09:31 PM.
 
Old 02-13-2017, 09:31 PM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
$PWD is not in your $PATH.

man mksh:
Code:
  . file [arg ...]
            This is called the “dot” command.  Execute the commands in file in
            the current environment.  The file is searched for in the
            directories of PATH.
Specify the full path.

Code:
# . .kshrc
ksh: .: .kshrc: No such file or directory
# . ./.kshrc
#
Or use source.
Code:
     source file [arg ...]
            Like . (“dot”), except that the current working directory is
            appended to the PATH in GNU bash and mksh.  In ksh93 and mksh,
            this is implemented as a shell alias instead of a builtin.

Last edited by AlucardZero; 02-13-2017 at 09:32 PM.
 
Old 02-13-2017, 09:46 PM   #4
killingthemonkey
Member
 
Registered: Mar 2011
Location: Winston-Salem, NC
Distribution: Fedora, CentOS, Linux Mint
Posts: 181

Original Poster
Rep: Reputation: 19
AlucardZero,
Using the full path resolved the issue. It's strange, I didn't have to do that before.
 
  


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
Converting scripts from Solaris korn shell to run on both Solaris and RHEL paulfoel Programming 2 07-19-2013 09:49 AM
korn shell tutorial/course kapilcool Linux - Certification 2 11-13-2006 10:18 PM
Korn Shell PS1 c19h28O2 Linux - Newbie 4 04-25-2006 07:56 AM
Arrays in Korn Shell...? vous Programming 1 03-26-2005 02:35 AM
Doesnt source .kshrc when ksh is started pkan Linux - Newbie 2 03-08-2004 08:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:38 AM.

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