10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I read a file (iplist.txt) ine-by-line in a loop which has the list of all the server hostnames.
With each hostname read; I do ssh and fire multiple commands to gather information about that systemas shown below.
#!/bin/bash
while IFS='' read -r line || ]; do
echo "Text read from file:... (3 Replies)
Discussion started by: mohtashims
3 Replies
2. Shell Programming and Scripting
Below is my code:
count=0
if
...
...
else
...
find * -prune -type d | sort -r -n | while read d; do
count=1
if ; then
echo "Count1:$count"
...
...
break 2;
fi
...
done
...
fi
echo "Count2:$count" (9 Replies)
Discussion started by: mohtashims
9 Replies
3. Shell Programming and Scripting
I have a loop like
while read i
do
echo "$i"
.
.
.
done < tms.txt
The tms.txt contians data like
2008-02-03 00:00:00
<space>00:00:00
.
.
.
2010-02-03 10:54:32 (2 Replies)
Discussion started by: machomaddy
2 Replies
4. Shell Programming and Scripting
Say you don't want to unpack the whole thing, just individual files or directories within a .tgz. How to do this? (1 Reply)
Discussion started by: stevensw
1 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
Following is the program that i have written in cygwin. The redirection of the unfound $param1 to error.txt file doesnt work.Can any one help?
#!/usr/bin/sh
fname=$1
sed 's/ //g' "$fname" > fname1
while read i
do
echo $i > file1
#param1 is script name
... (1 Reply)
Discussion started by: janardhanamk
1 Replies
6. UNIX for Dummies Questions & Answers
Hi everyone.
I wanted to print numbers from 1 to 5 in reverse order. For this I used the following code:
#!/bin/bash
x=5
while
do
echo $x
x=`expr $x - 1`
echo ""
done
echo ""
Well but on compiling the above code, it gives the following error.
... (3 Replies)
Discussion started by: grc
3 Replies
7. Shell Programming and Scripting
i have about 30 .EAR files, every ear file have 1 .JAR file.
so i need to extract .EAR files then extract .JAR files, and one important thing is that every archive must bee extracted to separate folder.
i try with gzip, but when i extract 30 ear files i cant make separate folders.... (1 Reply)
Discussion started by: waso
1 Replies
8. Shell Programming and Scripting
I am unable to access the value set inside the loop from outside loop .
Thought of taking this to forum , I had seen other replies also , where a pipe takes the execution to another shell and mentioned thats the reason we do not get the variable outside loop . But I am getting an issue and I am... (1 Reply)
Discussion started by: Armaan_S
1 Replies
9. Red Hat
Hi all,
I want to unpack some files .Files and their sizes are:
1. Linux9i_Disk1.cpio -- 500m
2. Linux9i_Disk2.cpio--- 600m
3.Linux9i_Disk3.cpio---- 250m
I used cpio -idmv Linux9i_Disk1.cpio command to unpack the files. But Its taking more time to unpack the files.What could be the... (2 Replies)
Discussion started by: William1482
2 Replies
10. Shell Programming and Scripting
I have a while loop like this
cat ${filename} | while read fileline
do
...
done
I need to access a variable value $newfile inside this while loop
How will i do that?? (6 Replies)
Discussion started by: codeman007
6 Replies
STAG-SPLITTER(1p) User Contributed Perl Documentation STAG-SPLITTER(1p)
NAME
stag-splitter - splits a stag file into multiple files
SYNOPSIS
stag-splitter -split person -name social_security_no file.xml
DESCRIPTION
Splits a file using a user specified parser (default xml) around a specified split node, naming each file according to the name argument
the files will be named anonymously, unless the '-name' switch is specified; this will use the value of the specified element as the
filename
eg; if we have
<top>
<a>
<b>foo</b>
<c>yah</c>
<d>
<e>xxx</e>
</d>
</a>
<a>
<b>bar</b>
<d>
<e>wibble</e>
</d>
</a>
</top>
if we run
stag-splitter -split a -name b
it will generate two files, "foo.xml" and "bar.xml"
input format can be 'xml', 'sxpr' or 'itext' - if this is left blank the format will be guessed from the file suffix
the output format defaults to the same as the input format, but another can be chosen.
files go in the current directory, but this can be overridden with the '-dir' switch
USAGE
stag-splitter [-split <ELEMENT-NAME>] [-name <ELEMENT-NAME>] [-dir <DIR>] [-format <INPUT-FORMAT>] [-outformat <OUTPUT-FORMAT>] <FILENAMES>
-p|parser FORMAT
FORMAT is one of xml, sxpr or itext, or the name of a perl module
xml assumed as default
-w|writer FORMAT
FORMAT is one of xml, sxpr or itext, or the name of a perl module
-split|s NODE
node to split on
-name|n NODE
field/element to use when naming files
will use surrogate IDs if this argument not specified
-dir|d DIR
write files to this directory
perl v5.10.0 2008-12-23 STAG-SPLITTER(1p)