10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
how to print first line of each repeated 2 fields only if i got files like :
USA|Tony|12:25:22:431
USA|John|14:22:42:981
USA|John|08:22:12:349
France|Adam|14:22:42:981
Italy|Tony|18:22:42:212
Italy|Tony|04:22:42:212
Italy|Tony|08:22:42:212
to make output like :
... (9 Replies)
Discussion started by: teefa
9 Replies
2. UNIX for Dummies Questions & Answers
I have a file that has the words I want to find in other files (but lets say I just want to find my words in a single file). Those words are IDs, so if my word is ZZZ4, outputs like aaZZZ4, ZZZ4bb, aaZZZ4bb, ZZ4, ZZZ, ZyZ4, ZZZ4.8 (or anything like that) WON'T BE USEFUL.
I need the whole word... (6 Replies)
Discussion started by: chicchan
6 Replies
3. Cybersecurity
Hey guys, new geek here, sorry I didnt see a intro section. But I do have a question and hope to make my stay here perma. I am interested in IT security, ands I really want to learn, I was hoping for whatever questions I had you guys could lead me through the narrowest path with a broad selection... (1 Reply)
Discussion started by: abeja
1 Replies
4. Shell Programming and Scripting
Hi All!
I need to write a script which reads a file and tries to insert into the DB using those values...
file format:
var1 var2 var3
var4 var5 var6
Now I want to read from the above file and trying to insert like...
insert into table1 values( var1, var2, var3 );
in a loop to... (2 Replies)
Discussion started by: games_icon
2 Replies
5. UNIX for Advanced & Expert Users
Dear All
I have a pattern which look like this :
2 20080226_18:02:09.749 ISC-Libya Egypt-Cairo2 111 IAM 2913258040 218927157966 b 61 REL f 143 RLC :COMMA:NCI=10,FCI=6101,CPC=0A,TMR=00,OFI=80,USI: :COMMB:: :RELCAUSE:15:
2 20080226_18:02:11.629 ISC-Libya Egypt-Cairo2 170 IAM 93572641... (8 Replies)
Discussion started by: zanetti321
8 Replies
6. UNIX for Advanced & Expert Users
I want a Bash Shell Script for taking backup of all files created to day and killing all the Process still active of mine at evening every day (1 Reply)
Discussion started by: vinayraj
1 Replies
7. Shell Programming and Scripting
Hello Guys,
I have written the following script to do certain job. I have more than 300 files, all are .pdb & .out files. and the files are (1,3,5,7,11,13,15,17,21,.......787,791,793,795).pdb /.out . But the way I created the for loop in my script works only one file at a time. But that is not... (2 Replies)
Discussion started by: chuchu
2 Replies
8. AIX
Hi guys,
I would like to inform you that I have cleared ....
IBM Certified Specialist - p5 and pSeries Administration and Support for AIX 5L V5.3 with 89%
thanks to you all.
Manu (0 Replies)
Discussion started by: b_manu78
0 Replies
9. UNIX for Dummies Questions & Answers
actually i have important question about unix / linux
i'm working on visuall basic and visuall c++
i heared from someone that i can't open them while i useing unix / linux
is that right?
if yes .......... what's the solution
if no ............. thanks :) :D :D
thanks my friends (1 Reply)
Discussion started by: M_Hafez
1 Replies
10. UNIX for Advanced & Expert Users
HI.
I just accidently wipe out my hard drive when i installed sun solaris, this is the last thing i remember, it ask me if want to delete the partition table, and i said yes" Im a retard" i thought solaris can't see xp partition table. Could anyone help me recover my data back, is it really... (21 Replies)
Discussion started by: souldier
21 Replies
divert(3) EN Tools divert(3)
NAME
Divert - Text Diversion Filter
SYNOPSIS
divert [-o outputfile] [-q] [-v] [inputfile]
DESCRIPTION
The divert program reads inputfile or from "stdin" and applies a 2-pass diversion filter to its contents. In pass 1 all diversion locations
are accumulated and in pass 2 these locations are recursively expanded at their dump positions. The diversion filter is controlled by
directives found in the input data:
{#NAME#} (or <<NAME>>)
This defines the dump position of the location NAME. All accumulated data which finally has to been diverted to NAME is inserted at
this data position. Notice: the final data of a location NAME has not to be known at this point, because the expansion of such
location dumps are done in pass 2. You can also dump a location more than once, but the contents is always the same, independent of
the data position where the location dump tag stays. The NAME can be any symbolic name matching "[a-zA-Z][a-zA-Z0-9_]*".
{#[!]NAME[!]#: (or ..[!]NAME[!]>>)
This enters the location NAME (or diverts the data flow to it, hence the name for this filter). In other words: the data flow now goes
on at location NAME. All following data (up to end of file or the next location leave tag) gets appended to location NAME. You can nest
diversions by entering other locations at any point, because the locations are remembered on a stack. The default entered location is
named ``"main"''. The top most location is named ``"null"'' which neither can be entered nor leaved explicitly. But of course the
``"null"'' diversion can be manually dumped, for instance when using it for error messages.
There are two special features for diverting data which are controlled by the ""!"" characters preceding or following the NAME
identifier:
!NAME
This sets the data flow position to the begin of location NAME, i.e. it actually discards the current (already diverted) contents
of location NAME before entering it. Use this to overwrite a locations contents.
NAME!
This marks this location entry as overwritable, i.e. it enters location NAME but when the corresponding leave tag is found, the
data-flow position for NAME gets automatically reset to its begin. Use this if you want to set the default contents for a location
which only gets used if no other diversions occur to it (because any following diversions to this location will be overwrite the
contents). This feature is usually used for a template scheme.
!NAME!
Just the combination of the above two features. Use this to both discard the current contents of location NAME and set a new
default for it.
:#[NAME]#} (or <<[NAME]..)
This leaves the current location, i.e. enters again the location which was active when this location was entered. There is no need to
leave all locations at the end of the input data. All still entered locations are automatically left at end of file because this is
essential for a template scheme.
Notice that there are two ways of using (and thinking) about the filtering mechanism this program provides:
Macro Mechanism
This is the "predefined" way of thinking here. Use it like this:
FOO
{#BAR#}
QUUX
{#BAR#:
BAZ
:##}
Here you are thinking of the mechanism as a macro mechanism where you expand a macro at one data position while you define it via begin
and end tags.
Diversion Mechanism
This is the alternative way of thinking. Use it like this:
FOO
<<BAR>>
QUUX
..BAR>>
BAZ
<<..
In other words: You are thinking of the mechanism as a diversion mechanism where you dump a location at one data position while you
divert to it by entering end leaving the location (here BAR) at other positions.
You can even intermix both ways because both are just alternative syntax variants which are treated the same.
EXAMPLE
{#HEAD#}
{#BODY#}
{#FOOT#}
{#FOOT#:
Quux
:##}
{#BODY#:
Bar
:##}
{#HEAD#:
Foo
:##}
OPTIONS
-o outputfile
This redirects the output to outputfile. Usually the output will be send to stdout if no such option is specified or outputfile is
``"-"''.
-q This sets quiet mode where warnings are suppressed.
-v This sets verbose mode where some processing information will be given on stderr.
AUTHORS
Ralf S. Engelschall
rse@engelschall.com
www.engelschall.com
Denis Barbier
barbier@engelschall.com
EN Tools 2014-04-16 divert(3)