LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-28-2013, 04:50 PM   #16
mdewell
LQ Newbie
 
Registered: Jan 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled

Hello shivaa,

Thanks for your help. When I try the login without the function commands in front of them, I get the same errors, as well as directory listings. I'm thinking of just using BASH instead, as I didn't know it, but there is a .bashrc. Yes I'm not too bright, as I wanted to use the .kshrc to allow for my .profile to be executed on each shell I ran from a current shell. Of course, I know there is a debate as to what is better, K-Shell or BASH. I was siding with Korn Shell, but alas, I think I'll go BASH.

Thanks for all of everyone's help.
 
Old 01-28-2013, 07:26 PM   #17
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Well, this is a generalisation, but normally (for non-root) most people use bash on Linux, but on commercial *nix eg Solaris, HP-UX, AIX, I've mostly seen ksh as the default.
YMMV
 
Old 01-28-2013, 10:43 PM   #18
Kenhelm
Member
 
Registered: Mar 2008
Location: N. W. England
Distribution: Mandriva
Posts: 333

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by mdewell View Post
: not foundome/mmdewell/.kshrc[4]:
: not foundome/mmdewell/.kshrc[7]:
: not foundome/mmdewell/.kshrc[18]:
: not foundome/mmdewell/.kshrc[28]:
: not foundome/mmdewell/.kshrc[51]:
This type of garbled error message comes from scripts which have carriage return characters in them, usually due to the script having been edited in Windows.
On what should be an empty line, the added carriage return (here represented by \r ) is seen by the shell as a command that it can't find and so it tries to send this message:
ksh: /???/home/mmdewell/.kshrc[51]:\r: not found
But the carriage return takes printing back to the start and overprints what is already there to give this:
: not foundome/mmdewell/.kshrc[51]:

http://en.wikipedia.org/wiki/Newline
http://en.wikipedia.org/wiki/Carriage_return

Code:
# Demonstration:
echo -e 'ksh: /???/home/mmdewell/.kshrc[51]:\r: not found'
: not foundome/mmdewell/.kshrc[51]:

# This will display any carriage returns in the script as '^M'
cat -v .kshrc             # Show non-printing characters

# Two ways of removing carriage returns:
sed 's/\r$//' infile > outfile # Remove only at the end of lines

tr -d '\r' < infile > outfile  # Remove all

Last edited by Kenhelm; 01-28-2013 at 10:47 PM.
 
Old 01-29-2013, 02:36 AM   #19
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Converting MSWin, Mac, *nix newlines to required format dos2unix http://linux.die.net/man/1/dos2unix & reverse unix2dos http://linux.die.net/man/1/unix2dos
 
  


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
[SOLVED] Removing newlines from output of cat command MahendraL Programming 5 12-20-2012 07:35 AM
[SOLVED] apt-get install pkg_name returns "update-alternatives: command not found" bpeacocke Linux - Software 5 10-12-2011 10:16 PM
If 'host' returns not found... SentralOrigin Linux - Networking 1 08-31-2010 08:43 PM
alsaconf returns error msg "getopt: command not found" bezdomny Linux - Hardware 4 07-13-2007 10:20 AM
executing a loaded module returns "command not found" error neelay1 Linux - Software 1 05-08-2006 03:25 PM


All times are GMT -5. The time now is 11:30 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