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!


Closed Thread
  Search this Thread
Old 11-10-2009, 02:55 AM   #1
Registered: Feb 2009
Posts: 47

Rep: Reputation: 15
Unhappy Issue with line command in RHEL- 5

Dear All,
I am getting the following error while running a shell script.
./ line 30: line: command not found

The following code snippet giving an error.
while linestr="`line`"; do
param1=`echo $linestr | sed -e 's/^\(.*\)\;\(.*\)\|\(.*\)$/\1/'`
param2=`echo $linestr | sed -e 's/^\(.*\)\;\(.*\)\|\(.*\)$/\2/'`
param3=`echo $linestr | sed -e 's/^\(.*\)\;\(.*\)\|\(.*\)$/\3/'`
echo '/'$param2'/{printf("'$param3' at %s\\n", substr($0,0,20))}' >> $tmpdir/${param1}_$tmpfile
done < $paramfile

"while linestr="`line`"; do" is the line number 30.

I am executing the shell script as follows
$ Outline.txt


Please let me know what is the problem with script.

Thanks and Regards
Old 11-10-2009, 07:52 AM   #2
Registered: Nov 2009
Location: India
Distribution: Xandros, Ubuntu
Posts: 74

Rep: Reputation: 16
Not sure what you're trying to accomplish here - but `line` expect an input with return carriage.

cat test
this is line

line < test
this is line
Old 11-10-2009, 08:37 AM   #3
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,808

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Closed Thread

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
slackware command line pipe-ing issue dv105v Linux - Newbie 2 11-19-2008 09:24 AM
Issue a command line statement from within a C/C++ program? DiBosco Programming 7 05-23-2008 07:34 PM
xine command line? or some other command line only engine? lumix Linux - Software 2 08-10-2007 10:46 AM
Command line/tools in CentOS/RHEL ? tuxuser19 Red Hat 5 10-01-2006 07:07 PM
Command to output file content line by line aznluvsmc Programming 2 09-12-2004 07:45 PM > Forums > Linux Forums > Linux - Newbie

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