11-26-2007
how to read a file till it encounters a blank line
Hi ,
I want to read a file starting with "*" up to till it encounters a blank line and to redirect this output to a different file.Plz suggest how to write a script for this.
e.g:-
* PK Sent Email (11.23)
CALYPSO 1243215 9116457 NEW TRAD FAILED Nov 23 2007 9:34AM OASYS: DPS: SINGCORP invalid use of FirmA
* PK sent email (11.20)
CALYPSO 1238957 9088029 ONRUNDEL FAILED Nov 20 2007 8:04AM OASYS: Unable to find CUSTOMER account BS
Here I need to read from * until it encounters a blank line.
My output should be
* PK Sent Email (11.23)
CALYPSO 1243215 9116457 NEW TRAD FAILED Nov 23 2007 9:34AM OASYS: DPS: SINGCORP invalid use of FirmA
Thanks,
Aditya
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In my script i am writing to a counter file the no of processes i had started,
that is each time i start a process, i will increment the content of counter file and also when the process ends i will decrement the content of the file.
after this i do some other activities, by now i want to... (1 Reply)
Discussion started by: senthilk615
1 Replies
2. Post Here to Contact Site Administrators and Moderators
Hi ,
I want to read a file starting with "*" up to till it encounters a blank line and to redirect this output to a different file.Plz suggest how to write a script for this.
e.g:-
* PK Sent Email (11.23)
CALYPSO 1243215 9116457 NEW TRAD FAILED Nov 23 2007 9:34AM OASYS: DPS:... (0 Replies)
Discussion started by: adityam
0 Replies
3. UNIX for Dummies Questions & Answers
Hi ,
I want to read a file starting with "*" up to till it encounters a blank line and to redirect this output to a different file.Plz suggest how to write a script for this.
e.g:-
* PK Sent Email (11.23)
CALYPSO 1243215 9116457 NEW TRAD FAILED Nov 23 2007 9:34AM OASYS: DPS: SINGCORP invalid... (1 Reply)
Discussion started by: adityam
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have reached at a specified offset from the start of file. My requirement is that I want to read only those lines, which have the string READ / ALTER / UPDATE. As soon as, none of these literals are found in the subsequent line, I want to stop reading. Is there any feature of grep which... (1 Reply)
Discussion started by: saurabhsinha23
1 Replies
5. Shell Programming and Scripting
So i have a file which contains paths to JPG images separated by a space.
I have to separate them each path to another file. So, I have to search all strings that start from /home/ and ends with .jpg or .png
Then write each one to another file...
Can you please help me on doing this???:cool: (11 Replies)
Discussion started by: hakermania
11 Replies
6. Shell Programming and Scripting
So, I want to read line-by-line a text file with unknown number of files....
So:
a=1
b=1
while ; do
b=`sed -n '$ap' test`
a=`expr $a + 1`
$here do something with b etc
done
the problem is that sed does not seem to recognise the $a, even when trying
sed -n ' $a p'
So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies
7. Shell Programming and Scripting
Hi,
I need to match lines after a pattern, upto the first blank line.
Searched in web and some forums but coulnt find the answer.
where <restart_step> =
10 -- Execute query
20 -- Write the contents to the Oracle table
30 -- Writing Contents to OUTPUT... (7 Replies)
Discussion started by: justchill
7 Replies
8. UNIX for Dummies Questions & Answers
Hello All,
i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file.
Any inputs are appreciated
... (3 Replies)
Discussion started by: victor.s
3 Replies
9. Shell Programming and Scripting
Hi All,
Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool.
Wraper script am trying is to do with above metion 2 files.
utility tool accepts :
a. userinfo file : which contains username
b. item file : which... (2 Replies)
Discussion started by: Optimus81
2 Replies
10. Shell Programming and Scripting
Hello,
I have a file as :-
ABC
DEF
GHI
JKL
<BlankLine>
MNO
PQR
STU
VWX
<BlankLine>
YZA
I need it as below:-
ABCDEFGHIJKL;
MNOPQRSTUVWX; (3 Replies)
Discussion started by: jassi10781
3 Replies
LEARN ABOUT CENTOS
amsuntar
AMSUNTAR(8) System Administration Commands AMSUNTAR(8)
NAME
amsuntar - Amanda Application to interface with native tar utility available on solaris platforms
DESCRIPTION
Amsuntar is an Amanda Application API script. It should not be run by users directly. It uses Solaris bundled tar utility to backup and
restore data. Currenty ACLs from ZFS file system can only be backed up using the solaris supplied tar utility.
The diskdevice in the disklist (DLE) must be the directory to backup.
Solaris 10 supports Role Based Access Control(RBAC) which is enabled by default. To run backup operations using sun tar utility by under
privileged user like amandabackup, amandabackup user need to have proper roles and profiles, specially "Media Backup" profile/role. This
can be done using 'usermod -P "Media Backup" amandabackup' command.
PROPERTIES
This section lists the properties that control amsuntar's functionality. See amanda-applications(7) for information on application
properties and how they are configured.
BLOCK-SIZE
Optional tar read or write block size. The default is 256.
DIRECTORY
If set, suntar will backup from that directory instead of the diskdevice set by the DLE. On restore, the data is restore in that
directory instead of the current working directory.
EXTENDED-ATTRIBUTES
Include extended attributes in archive. The default is YES.
EXTENDED-HEADERS
Write tar file with extended headers. With this optiion the modification time is maintained with a granularity of microseconds,Long
file names and file sizes greater than 8GB can be archived. The default is YES.
SUNTAR-PATH
The path to the suntar binary. The default is set when Amanda is built.
LANG
Default LANG is "C". suntar require an UTF-8 LANG if you have UTF-8 filename and it is configured for extended headers. A good value
can be "en_US.UTF-8" if that locale is installed on your machine.
NORMAL
List all regex (Perl Regular Expression syntax) that are normal output from sun tar. These output are in the "FAILED DUMP DETAILS"
section of the email report if the dump result is STRANGE or FAILED. Default values:
is not a file. Not dumped$
same as archive file$
To treat one of these default patterns differently, specify it explicitly in a different property.
IGNORE
List all regex (Perl Regular Expression syntax) that amanda ignore. These output are never in the email report.
STRANGE
List all regex (Perl Regular Expression syntax) that are strange output from sun tar. The result of the dump is STRANGE if sun tar
produce a strange output. These output are in the "FAILED DUMP DETAILS" section of the email report. Default values:
: invalid character in UTF-8 conversion of
: UTF-8 conversion failed.$
To treat one of these default patterns differently, specify it explicitly in a different property.
ERROR
List all regex (perl Regular Expression syntax) that are error output from sun tar. All sun tar output that doesn't match a normal,
ignore or strange regex are error by default. The result of the dump is FAILED if sun tar produce an error output. These output are in
the "FAILED DUMP DETAILS" section of the email report. Default values:
: Permission denied$
To treat one of these default patterns differently, specify it explicitly in a different property.
SEE ALSO
amanda(8), amanda.conf(5), amanda-applications(7)
The Amanda Wiki: : http://wiki.zmanda.com/
AUTHORS
Satya Ganga <gast@zmanda.com>
Zmanda, Inc. (http://www.zmanda.com)
Jean-Louis Martineau <martineau@zmanda.com>
Zmanda, Inc. (http://www.zmanda.com)
Dustin J. Mitchell <dustin@zmanda.com>
Zmanda, Inc. (http://www.zmanda.com)
Amanda 3.3.3 01/10/2013 AMSUNTAR(8)