The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Read a file line by line VENC22 UNIX for Dummies Questions & Answers 4 10-30-2008 11:09 AM
read file until certain line position finalight Shell Programming and Scripting 5 05-21-2008 03:16 AM
How to read last line of a txt file? yongho UNIX for Dummies Questions & Answers 2 06-13-2005 01:20 PM
read line from file rein Shell Programming and Scripting 5 04-15-2005 02:32 AM
How to read from a file line by line and do stuff spaceship Shell Programming and Scripting 4 03-17-2005 09:47 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-24-2008
kittusri9 kittusri9 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 40
read the file line by line

Hi All

Please help me , i have one big problem

I need to read this files line bye line
and print take it as arugument for another command
fileslist.txt
------------
112040108174516.txt
112040108174516.txt
112040108174516.txt
112040108174516.txt
112040108174516.txt
112040108174516.txt
112040108174516.txt



i want to print this list line by line my window.

Thanks in advance.
  #2 (permalink)  
Old 04-24-2008
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
Code:
#!/bin/ksh

while read line 
do
  myOtherCommand "${line}"
done < 'fileslist.txt'
  #3 (permalink)  
Old 04-24-2008
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2007
Location: Bangalore
Posts: 377
do a try for this---

cat filename | while read line
do
echo $line
done

thanks
  #4 (permalink)  
Old 04-24-2008
kittusri9 kittusri9 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 40
problem with conditions if, for , while

Hi All,

when iam running the script with if or while
it showing following erros

Please any one clarify this

my script is:
------------
cat fileList.txt | while read line
do
echo $line
done

output:
--------
searchGateway.sh: line 14: syntax error near unexpected token `done'
searchGateway.sh: line 14: `done'


if i use if conditions
it shows error like
searchGateway.sh: line 14: syntax error near unexpected token `fi`
searchGateway.sh: line 14: `fi'

Please help me
Thankyou guys
Krish
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0