10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear unix wizards,
I'd be very grateful for your help with the following.
I have a hypothetical file (file.txt) with three columns:
111 4 0.01
112 3 0.02
113 2 0.03
114 1 0.04
115 1 0.06
116 2 0.02
117 3 0.01
118 4 0.05
Column 2 consists of pairs of integers from 1 to 4 (each... (5 Replies)
Discussion started by: aberg
5 Replies
2. Shell Programming and Scripting
Hi all,
Please guide me writing this script
Follwing is the file which I have created, which contains the files to be copied.
cat system1-dr.txt
/etc/passwd
/etc/shadow
/etc/group
/etc/vfstab
/etc/profile
/etc/default/init
/etc/shells
/etc/dfs/dfstab
/etc/dfs/sharetab... (11 Replies)
Discussion started by: manalisharmabe
11 Replies
3. Shell Programming and Scripting
Hi,
I am completely new to shell scripting. Basically I am wanting to create a simple while loop script to check if a network connection is available from 'netstat -a' and if its present then output a character to the serial port. I think i am nearly there.. but need some assistance.. this is... (9 Replies)
Discussion started by: zippyzip
9 Replies
4. Shell Programming and Scripting
#!/bin/bash
count=1
while read line
do
if (($count > 4)); then
awk -v var1="$count" '{printf "%3s%8s%11s%11s%11s\n",var1,$2,$3,$4,$5}'
else
echo $line
fi
count=$((count+1))
done < posre_sub.itp > test
cat test
INPUT:
; position restraints for... (3 Replies)
Discussion started by: origamisven
3 Replies
5. UNIX for Dummies Questions & Answers
Hello forum memebers.
can you correct the simple while program.
#! /bin/ksh
count=10
while
do
echo $count
count='expr$count-1'
done
I think it will print 10 to 1 numbers but it running for indefinite times. (2 Replies)
Discussion started by: rajkumar_g
2 Replies
6. Shell Programming and Scripting
apologies for the basicness of this question, but within a for loop how can i "list" my values as opposed to adding them to the same line
for example if i use this it works fine
for n in peter paul david
do
echo "my name is $n"
done
but i wanted to list my items ( i have quite a... (2 Replies)
Discussion started by: rethink
2 Replies
7. Shell Programming and Scripting
I am trying to create a simple ksh loop script. What I've pasted below is not working. Any help is appreciated.
typeset -i count
typeset -i tcount
count=0
tcount=0
while $tcount >= 11
do
print "\$count is $count"
pwd
ls -l
sleep 30
$(( $tcount = $count + 1 ))
... (5 Replies)
Discussion started by: musikman65
5 Replies
8. Shell Programming and Scripting
Hello
I am a beginner of shell scripting and i am having trouble to do a for loop.
I want a for loop to do stuff 3 times.
i.e.
in visual basic i do this
for (counter = 0; counter < 3; counter++)
on my shell script i have something like this at the moment
... (7 Replies)
Discussion started by: arex876
7 Replies
9. Shell Programming and Scripting
I haven't done any scripting for quite a while and was trying to remember how to do a script with a for loop that uses another command for input straight from the terminal, IE:
for num in `cat somefile | awk <whatever>` do echo $num; echo blah; echo blahblah; done;
Hopefully something quick... (1 Reply)
Discussion started by: Vryali
1 Replies
10. Shell Programming and Scripting
I have written a script that countsdown from 20 to 1 and has a sleep in between each count but I want to make it sleep for half a second but I get errors whenever I change the sleep from 1 second to half a second any ideas? I am using Sun OS 5.9 heres what I've got:
X=0
while
do
echo... (3 Replies)
Discussion started by: Brokeback
3 Replies