LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 07:54 PM   #1
killingthemonkey
Member
 
Registered: Mar 2011
Location: Winston-Salem, NC
Distribution: Fedora, CentOS, Linux Mint
Posts: 259

Rep: Reputation: 24
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 08:07 PM.
 
Old 02-13-2017, 08: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 08:31 PM.
 
Old 02-13-2017, 08: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 08:32 PM.
 
Old 02-13-2017, 08:46 PM   #4
killingthemonkey
Member
 
Registered: Mar 2011
Location: Winston-Salem, NC
Distribution: Fedora, CentOS, Linux Mint
Posts: 259

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


Reply



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 08:49 AM
korn shell tutorial/course kapilcool Linux - Certification 2 11-13-2006 09:18 PM
Korn Shell PS1 c19h28O2 Linux - Newbie 4 04-25-2006 06:56 AM
Arrays in Korn Shell...? vous Programming 1 03-26-2005 01:35 AM
Doesnt source .kshrc when ksh is started pkan Linux - Newbie 2 03-08-2004 07:54 PM

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

All times are GMT -5. The time now is 04:15 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
Open Source Consulting | Domain Registration