Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

line(1) [xfree86 man page]

line(1)                                                            User Commands                                                           line(1)

NAME
line - read one line SYNOPSIS
line DESCRIPTION
The line utility copies one line (up to and including a new-line) from the standard input and writes it on the standard output. It returns an exit status of 1 on EOF and always prints at least a new-line. It is often used within shell files to read from the user's terminal. EXIT STATUS
Exit status is: 0 Successful completion >0 End-of-file on input. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
sh(1), read(2), attributes(5) SunOS 5.10 1 Feb 1995 line(1)

Check Out this Related Man Page

line(1)                                                            User Commands                                                           line(1)

NAME
line - read one line SYNOPSIS
line DESCRIPTION
The line utility copies one line (up to and including a new-line) from the standard input and writes it on the standard output. It returns an exit status of 1 on EOF and always prints at least a new-line. It is often used within shell files to read from the user's terminal. EXIT STATUS
Exit status is: 0 Successful completion >0 End-of-file on input. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
sh(1), read(2), attributes(5) SunOS 5.10 1 Feb 1995 line(1)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

new line at last line

Hay hay all, I wish to add a new blank line to the end of a file using sed. I've tried: sed '/$/{G}' /tmp/$$.ace >>! /elsewhere/file.dat but it fails. I do not think that I am matching the last line right? So how do I do it? (11 Replies)
Discussion started by: gsjf
11 Replies

2. Shell Programming and Scripting

Create new file by searching another file

Hi , I need to write a korn shell to read a file, say Test.txt, and search the file for key words like "email", "name", etc line by line. Whatever is found on a line, send it to an output file. Do this until the end of the file. I have the following code below, that I'm trying to tweak but it... (13 Replies)
Discussion started by: leo
13 Replies

3. Shell Programming and Scripting

display result from user input

how can i only display the result according to user input? For example: i have a data file(in the attachement), when the user enter "1" it will only display whole records with pid from the data file matches to the users entered. (13 Replies)
Discussion started by: thms_sum
13 Replies

4. Shell Programming and Scripting

Read last line of file to check for value

Folks How best to read the last line of a file, to check for a particular value? This is the last line of my file...... 00000870000002000008 0000000020000 ......I need to check that this line contains '70' in positions 7 and 8, before I continue processing. Regards ... Dave (12 Replies)
Discussion started by: daveaasmith
12 Replies

5. Shell Programming and Scripting

Deleting a line from a flatfile using Shell Script

Hi All, Can Anyone please tell me,how can I delete a line from a file. I am reading the file line by line using whil loop and validating each line..Suppose in the middle i found a particular line is invalid,i need to delete that particular line. Can anyone please help. Thanks in advance,... (14 Replies)
Discussion started by: dinesh1985
14 Replies

6. Shell Programming and Scripting

Cut and WhiteSpace Problem

Hi, I have a shell script that reads a parameter file to set variables. I have an issue when the parameter I try to read contains whitespace. e.g File Contents Code The result is SUBJECT is set to and I want subject set to I've tried different variations but nothing seems to... (19 Replies)
Discussion started by: Greygor
19 Replies

7. Shell Programming and Scripting

While read line ignores the '\' in file content

I need to read temp.$i file content line by line through while loop but somehow the '\' do not appear in output.. Can someone guide how to read this exact content line by line in unix : if then cat temp.$i | head -1 # the file content appears fine while... (13 Replies)
Discussion started by: Prev
13 Replies

8. Shell Programming and Scripting

Maximum number from input by user

I am trying to calculate the maximum number from four numbers input by the user. I have the following code, but it does not work. It says there's an error with the last line "done". Any help would be appreciated. max=0 echo "Please enter four numbers: " for i in 1 2 3 4 do read number... (17 Replies)
Discussion started by: itech4814
17 Replies

9. Shell Programming and Scripting

Add new line after ' char

Hello experts, I need to convert one file into readable format. Input file is like following line. STG,12345,000,999,' PQR, 2345,000,999,' XYZ,7890,000,999, Output should be following (After ' char new line char should be added.) STG,12345,000,999,' PQR, 2345,000,999,' ... (16 Replies)
Discussion started by: meetmedude
16 Replies

10. Shell Programming and Scripting

looping and saving output of each line separately

I have been trying this program for a long time. I am trying to read a file named "odon" line by line; read the first line, send it to do a command saved in a file "perm", once the first line has finished going through the content of the file perm, the result is saved with the number of the line.... (17 Replies)
Discussion started by: iconig
17 Replies

11. Shell Programming and Scripting

Commenting a specific line and inserting a new line after commented line.

Hello All, I have following file contents cat file #line=aaaaaa #line=bbbbbb #line=cccccc #line=dddddd line=eeeeee #comment=11111 #comment=22222 #comment=33333 #comment=44444 comment=55555 Testing script Good Luck! I would like to comment line line=eeeeee and insert a new line... (19 Replies)
Discussion started by: manishdivs
19 Replies

12. Shell Programming and Scripting

Adding filename and line number from multiple files to final file

Hi all, I have 20 files (file001.txt upto file020.txt) and I want to read them from 3rd line upto end of file (line 1002). But in the final file they should appear to start from line 1. I need following kind of output in a single file: Filename Line number 2ndcolumn 4thcolumn I... (14 Replies)
Discussion started by: bioinfo
14 Replies

13. Shell Programming and Scripting

How to process only new line of tail -f command from live log file?

Hi, I want to read a live log file line by line and considering those line which are newly added to file Below code I am using, which read line but as soon as it read new line from log file its starts processing from very first line of file. tail -F /logs/COMMON-ERROR.log | while read... (11 Replies)
Discussion started by: ketanraut
11 Replies

14. UNIX for Dummies Questions & Answers

Performance issue to read line by line

(11 Replies)
Discussion started by: balu1729
11 Replies

15. UNIX for Beginners Questions & Answers

Read 2 file line by line @ same time

HI All, I am aware of reading one file line by line but now my requirement is to read 2 file line by line as below explained. I have 2 files as below file 1 with spaces and file 2 same as file1 but without space and () brackets now i have to read both file line by line and use first line of... (13 Replies)
Discussion started by: abhaydas
13 Replies