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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)