10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi There
Just created a .sql script and executes fine, it comes back with two lines of results, I was wondering is there a way of adding up the two results to get a round number. I tired wc -l but that didn't work.
Many Thanks for your help
psql -t -f... (3 Replies)
Discussion started by: simpsa27
3 Replies
2. Shell Programming and Scripting
Hello everyone,
I am doing a check of the disk space using df -h, I want to combine the result in break line; but the result after while/done is empty:
# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 20G 14G 4.6G 75% /
/dev/root 20G 14G 4.6G 75% /... (15 Replies)
Discussion started by: Abu Rayane
15 Replies
3. Shell Programming and Scripting
find $SRC -type f -name *.emlx |
while read FILE
do
if :
then sed -n '/From/p' $FILE
fi
done > $DEST-output.txt
The loop above spits out a .txt file with several lines that look like this:
From: John Smith <jsmith@company.com>
How can I narrow that sed result to spit out the email... (5 Replies)
Discussion started by: sudo
5 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I am trying to use awk to do the following:
For a column:
5
3
4
2
7
I want to start with the first entry then add the second to the first, third to second ..etc:
5
8
12
14
21 (5 Replies)
Discussion started by: cosmologist
5 Replies
5. Shell Programming and Scripting
I have files structured in stanzas, whose title is '', and the rest couples of 'id: value'. I need to find text within the title and return the whole stanzas that match the title.
The following works:
awk 'BEGIN{RS="";IGNORECASE=1}/^\/' myfileI would need to count all of the occurences, though,... (7 Replies)
Discussion started by: hermes14
7 Replies
6. Shell Programming and Scripting
Here is one I am baffled with; I have not used unix for a while and now that I am back it has been fun remembering and I have enjoyed it, for the most past. this is in ksh.
I need to search in a file for the line with X1 and cut columns 20-25, put them into a variable, added them (dollar... (3 Replies)
Discussion started by: CougarMutt
3 Replies
7. Shell Programming and Scripting
I'm trying to add the paths of all the xml files in certain directories to an array. I want to use the array later in my code. Anyway, for some reason this isn't working. Any help would be appreciated.
Path_Counter=0
for result in "find * -name '*.xml'"; do
XmlPath="$result"
echo... (2 Replies)
Discussion started by: Fly_Moe
2 Replies
8. Shell Programming and Scripting
Hi,
I have the following situation:
Param1Values = AAAA,BBBB
Param1=$(echo $Param1Values| tr "," "\n")
for x in $Param1
do
db2 select X from Y where Z IN ('$x')
done
Obviously the above will perform the select 'x' amount of times.
Is there a way in which i can... (13 Replies)
Discussion started by: RichZR
13 Replies
9. Shell Programming and Scripting
Hi Perl Gurus , need URGENT HELP PLEASE !!!!!
I have one recursive Perl function which takes path of any directory as argument and returns array containing all the sub folders inside it recursively.
Now the problem is that it works well if i use it with one time but the problem is that when... (0 Replies)
Discussion started by: anthriksh2000
0 Replies
10. Shell Programming and Scripting
Folks,
I have a 3 problems. In a sh script, I call a server name from a list and rex to a distant machine to get the boot date.
for i in `cat list`
do
(echo "$i|"; /bin/rexsh $i -l bozo -t10 who -b | cut -d" " -f14-16) >>getBootTimes.out
sleep 1
done
The results are on 2 lines instead... (8 Replies)
Discussion started by: linux_lou
8 Replies