processing line in file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting processing line in file
# 8  
Old 01-23-2006
From the ksh man page:
Quote:
< file
standard input is redirected from file, which is opened for reading.
See the below code:
Code:
while read line; do
 :
 :
done < /path/to/file/with/filesystem_list

Here, the read command is having the standard input redirected from the file "/path/to/file/with/filesystem_list".
# 9  
Old 01-23-2006
Thanks for the clarification..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

File Processing: Handling spaces in a line

Hi All, Iam trying to get a file processed and some lines have spaces...the below is not working Want to remove empty line Want to remove lines that start with # Avoid line with substring WHOA When trying to get the substring from the var also Iam having trouble file is like VAR=VALUE,... (13 Replies)
Discussion started by: baanprog
13 Replies

2. Programming

awk processing / Shell Script Processing to remove columns text file

Hello, I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this : This is the output of ls command : I stored the output in a file filelist 1.1M... (5 Replies)
Discussion started by: ajayram
5 Replies

3. Shell Programming and Scripting

[awk] line by line processing the same file

Hey, not too good at this, so I only managed a clumsy and SLOW solution to my problem that needs a drastic speed up. Any ideas how I write the following in awk only? Code is supposed to do... For every line read column values $6, $7, $8 and do a calculation with the same column values of every... (6 Replies)
Discussion started by: origamisven
6 Replies

4. Shell Programming and Scripting

Line processing

If I have a line say like this 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 I want column 16 to be moved into column 4 and the rest same, like this 1 2 3 16 5 6 7 8 9 10 11 12 13 14 15 Using awk, I know that replacing $4 with $16 and typing all the column numbers will help. But, I have more... (4 Replies)
Discussion started by: jacobs.smith
4 Replies

5. Shell Programming and Scripting

[string processing]Adding new line in file

I have a report file which somewhere has a lines starting with word ".sub" I have a new variable named $new. What i am trying to do is insert the content of $new just before the occurrence of ".sub" in the report file. How can I do that? (11 Replies)
Discussion started by: animesharma
11 Replies

6. Shell Programming and Scripting

reading a file inside awk and processing line by line

Hi Sorry to multipost. I am opening the new thread because the earlier threads head was misleading to my current doubt. and i am stuck. list=`cat /u/Test/programs`; psg "ServTest" | awk -v listawk=$list '{ cmd_name=($5 ~ /^/)? $9:$8 for(pgmname in listawk) ... (6 Replies)
Discussion started by: Anteus
6 Replies

7. Shell Programming and Scripting

awk, perl Script for processing a single line text file

I need a script to process a huge single line text file: The sample of the text is: "forward_inline_item": "Inline", "options_region_Australia": "Australia", "server_event_err_msg": "There was an error attempting to save", "Token": "Yes", "family": "Family","pwd_login_tab": "Enter Your... (1 Reply)
Discussion started by: hmsadiq
1 Replies

8. Shell Programming and Scripting

Reading a file line by line and processing for each line

Hi, I am a beginner in shell scripting. I have written the following script, which is supposed to process the while loop for each line in the sid_home.txt file. But I'm getting the 'end of file' unexpected for the last line. The file sid_home.txt gets generated as expected, but the script... (6 Replies)
Discussion started by: sagarparadkar
6 Replies

9. Shell Programming and Scripting

File processing line by line

Hi, I am doing file processing line by line. while reading each line at a specified location I am searching for a particular character and then write that line to another file. Problem is while writing to another file it was supressing the spaces, which I don't want to do. Any help is... (1 Reply)
Discussion started by: suma
1 Replies
Login or Register to Ask a Question