Here is a Bourne script, someone who knows awk may write something more elegant, I'm not sure if your output of only two lines is intentional, I have taken that as not intentional and assumed that you want the lines with a number at the beginning but you only want the error lines mentioned once in conjunction with the preceding numbered Line.
I made the input file contain a different abc number per line so that we can prove which lines have been displayed:
The script is:
Here is a run of the script:
If my assumptions are wrong then please say so...
Last edited by TonyFullerMalv; 02-24-2010 at 06:57 PM..
I have a file with the below lines
1521
1522
1523
1524
1525
1526
...
174 lines all numbers like above. I want the above file to appear as below.
1521,1522,1523,1524.....
All the numbers should be separated by comma.
Pls tell me how to do this ....
Thanks in advance. (8 Replies)
Hi,
Can anybody throw somelight on how to handle date in a shell script?
I need to pass the date in this format 'yymmdd' and then pad it to a file.
The way in which i've handled is given below, but the date is not getting passed rather the file is getting created with a null date. Any... (2 Replies)
Hi
I have to do the following.I have to format a file test.t
The contents are
# Header 1231
xyz
asdf
asdapsdcsd
//string1 = "pqrs"
//string1 = "abcd"; //info
//string1 = "*pqrs"; //add
string1 = "#123"; //sub
//string1 = "#1234567890"
data = check(string1)
//string1 = "#1234567890"... (12 Replies)
How to add the filename to end of each line with | as seperator, except first and last line of the file(s) in directories(with diff tree structure) using shell script?. And also how to replace a list of strings with another set of strings, which is present in a file?.
Kindly help out on... (1 Reply)
Hi,
I am writing a script and I need to calculate last weeks date.
I get the current date as;
today=`date '+%Y%m%d'`
and I need last week inthe same format.
Thanks, (2 Replies)
I have a file with contents something similar to as below :
SVCNAME,12m-1a,1a-2a,2a-3a,3a-4a,5a-6a,6a-7a,7a-8a,8a-9a,9a-10a,10a-11a,11a-12n,12n-1p,13p-14p,14p-15p,15p-16p,16p-17p,17p-18p,18p-19p,19p-20p,20p-21p,21p-22p,22p-23p,11p-12m, TOTALS... (5 Replies)
there is one shell which calls for different sql scripts.
output of different are formatted in frame like structure.i want columnar wise formatting to be done in such a manner that output of one sql may be comon input of rest sqls .
ERC DML
Closure Date
ER DML
SAP Transfer Date
... (0 Replies)
Hi Team,
We have a requirement where we need to format input file using shell script by meeting the below conditions.
1. 1. Ignore first 549 characters of that file.
2. 2. After that we need to make a file of 100 characters per line, repeat it until the 3rd ... (16 Replies)
Dear all,
I am new to shell scripting and have tried to make a small program for fun sake that tells age from the last number of cell phone and birth year.
At the end we get a final 3 digit number and the first digit represents the last digit of cell phone and rest 2 numbers shows age. eg. 423... (4 Replies)
Discussion started by: stg44
4 Replies
LEARN ABOUT HPUX
finger
finger(1) General Commands Manual finger(1)NAME
finger - user information lookup program
SYNOPSIS
[options] user_name ...
DESCRIPTION
By default, lists for each user_name on the system:
o Login name,
o Full given name,
o Terminal write status (if write permission is denied),
o Idle time,
o Login time,
o User's home directory and login shell,
o Any plan the user has placed in file in their home directory,
o Project on which they are working from the file also in the home directory,
o office location and phone number (if known),
o last time the user received the mail, and last time the user read the mail.
Idle time is in minutes if listed as a single integer, hours and minutes if a is present, or days and hours if a is present. Account names
as well as first and last names of users are accepted.
can also be used to list users on a remote machine. The format for user_name is user_name@host. If user_name is not specified, the remote
system (HP-UX or non-HP-UX) uses its default standard format for listing user information.
Options
recognizes the following options:
Suppress printing the user's home directory and shell.
Suppress printing the header that is normally printed
in a short-format printout.
Suppress printing the
file in a long-format printout.
Force ``idle'' output format.
Similar to short format except that only the login name, terminal, login time, and idle time are printed.
Force long output format.
Match arguments only on user name.
Suppress printing of the
files
Force quick output format.
Similar to short format except that only the login name, terminal, and login time are printed.
Print the user's host name.
Force short output format.
Suppress printing the full name in a short-format printout.
WARNINGS
Only the first line of the file is printed.
AUTHOR
was developed by the University of California, Berkeley.
FILES
who file
last login file
for users names, offices, ...
plans
projects
mail directory
SEE ALSO chfn(1), who(1), utmpd(1M).
finger(1)