08-11-2005
script to run shell command and insert results to existing xml file
Hi. Thanks for any help with this. I'm not new to programming but I am new to shell programming. I need a script that will
1. execute 'df -k' and return the volume names with specific text
2. surround each line of the above results in opening and closing xml tags
3. insert the results of step #2 into an existing file after a specific opening xml tag.
Any help would be greatly appreciated!
littlejon
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi Guys,
the requirement is like this,
i am having a error log file in this format,
4594.493: parallel nursery GC 2594592K->2544691K (2969600K), 30.848 ms
4605.958: parallel nursery GC 2634887K->2584986K (2969600K), 38.900 ms
4619.079: parallel nursery GC 2822555K->2774812K... (12 Replies)
Discussion started by: gsprasanna
12 Replies
2. Shell Programming and Scripting
I have an xml file:
<AutoData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Table1>
<Data1 10 </Data1>
<Data2 20 </Data2>
<Data3 40 </Data3>
<Table1>
</AutoData>
and I have to remove the portion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" only.
I tried using sed... (10 Replies)
Discussion started by: Gary1978
10 Replies
3. Shell Programming and Scripting
Hi ,
I need some inputs on how to open a file (file.txt) and parse the text example aaa of the file and bbb of the file and add the text zzzz once i parse (aaa and bbb) and followed by the remaining of the text as it is in the file using perl programming.
Thanks in advance (3 Replies)
Discussion started by: madhul2002
3 Replies
4. Shell Programming and Scripting
I have a source file like this,
L4058S462 34329094 F51010141TK1070000483L4058S462 34329094 0232384840 381892 182 5690
L4058S462 34329094 F51020141FIRST CLEARING, LLC A/C 3432-9094
L4058S462 34329094 F51030141JOHAN HOLMQVIST ... (1 Reply)
Discussion started by: saravanamr
1 Replies
5. Shell Programming and Scripting
How can I insert the command executed on the shell into the first line of my output file?
For example if I execute;
zcat *.gz |grep “User5501” > users.out
How can I make my users.out look like;
zcat *.gz |grep “User5501” > users.out
User5501 PA
User5501 UA
User5501 ZA... (3 Replies)
Discussion started by: lewk
3 Replies
6. Shell Programming and Scripting
Hi ,
I have a below xml:
<ns:Body>
<ns:result>
<Date Month="June" Day="Monday:/>
</ns:result>
</ns:Body>
i have a lookup abc.txtt text file with below details
Month June July August
Day Monday Tuesday Wednesday
I need a output xml with below tags
<ns:Body>
<ns:result>... (2 Replies)
Discussion started by: Nevergivup
2 Replies
7. Shell Programming and Scripting
Hi All,
I have one query, I managed to run script with user inputs through command line or with 1 file.
But I need to read a txt file/xml file in which user can mention multiple sets of answers and script should run for each set till it reach the EOF.
Thanks in advance
for example, the file... (3 Replies)
Discussion started by: rv_champ
3 Replies
8. Shell Programming and Scripting
Linux System having all Perl, Python, PHP (and Ruby) installed
From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file
eg
eg
a Shell script run in a case statement call to run a php file, also Perl or/and Python file???
Like
#!/usr/bin/bash
....
....
case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies
9. UNIX for Beginners Questions & Answers
I want to write a one line script that outputs the result of multiple xml tags from a XML file. For example I have a XML file which has below XML tags in the file:
<EMAIL>***</EMAIL>
<CUSTOMER_ID>****</CUSTOMER_ID>
<BRANDID>***</BRANDID>
Now I want to grep the values of all these specified... (1 Reply)
Discussion started by: shubh752
1 Replies
10. UNIX for Beginners Questions & Answers
I have multiple xml files where i want to update a subnode if the subnode project points to different project or insert a subnode if it doesn't exist using a xmlstarlet or any other command that can be used in a bash script.
I have been able to update the subnode project if it doesn't point to... (1 Reply)
Discussion started by: Sekhar419
1 Replies
LEARN ABOUT DEBIAN
strip_stx
strip_stx(1) General Commands Manual strip_stx(1)
NAME
strip_stx - a simple literate programming tool
SYNOPSIS
strip_stx [ -c commentchars ] [ -B open close ] [ file file ... ]
DESCRIPTION
strip_stx takes all structured text (Stx) markup away from the listed files, leaving only text in preformatted blocks. If no files are
listed, standard input is read instead. The result is written to standard output.
This is intended as a simple literate programming tool: programmers may write their programs as documents, processing them with stx2any for
documentation and publication but with strip_stx for compilation / running the code.
More information about Stx is on the manpage of stx2any.
OPTIONS
-c commentchars
comment out the non-code portions (text outside preformatted blocks) with the given commentchars at the beginning of every line.
If this option (or the next one) is not given, non-code portions are simply deleted.
-B open close
surround the non-code portions with (comment-)opening and closing markers open and close respectively. This option can be used
together with the -c option.
--version, -V
Just show version information and exit.
--help, -?
Just show a short help message and exit.
EXAMPLES
strip_stx parse.py.stx > parse.py
Strip documentation away from the source file parse.py.stx, supposedly only leaving python code there.
strip_stx -B '/*' ' */' -c ' * ' my.c.stx > my.c
Make a literate C code document into proper C source file, leaving the documentation in neatly-formatted comments.
strip_stx -B 'cat < < EOT' 'EOT' embshell.stx > embshell.sh
Turn the document embshell.stx into an "embedded shell" script, where all non-program portions are printed to the standard output when exe-
cution reaches them. This is akin to PHP or eperl; but strip_stx is not really meant for this. There are other options for making embed-
ded scripts, such as defining your own markup for the code portions or handling the program logic with m4 within stx2any.
SEE ALSO
stx2any (1)
AUTHOR
This page is written by Panu A. Kalliokoski.
Panu A. Kalliokoski strip_stx(1)