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
Hello,
when running the scripts below I am not getting message bb2.
Can you please help?
#!/bin/bash
TLOG=/tmp/bb/amatest.log
FTPRESULTS=/tmp/bb/amlist
export TLOG FTPRESULTS
>$TLOG
>$FTPRESULTS
echo bb1
sftp -oPort=2222 XXXXXXXXXXXXX@sftp.userssedi.com <<EOF
cd... (5 Replies)
Discussion started by: biljana
5 Replies
3. Shell Programming and Scripting
Hi! I am just starting to learn scripting.
I am trying a simple script in bash and zsh
I have two questions:
First: Why zsh does not expand the var M? What I am doing wrong?
localhost galanom # bash -c 'M="m1 m2 m3 m4 m5"; for x in $M; do echo "<$x>"; done'
<m1>
<m2>
<m3>
<m4>
<m5>... (1 Reply)
Discussion started by: galanom
1 Replies
4. Shell Programming and Scripting
#!/bin/bash
cd /media/disk-2
Running
./run.sh
it's not changing directory.Why? (6 Replies)
Discussion started by: cola
6 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
Maybe because its Friday, but I can't get a simple while loop to work!
#!bin/bash
i=0
while
do
echo "Hello"
((i++))
done (17 Replies)
Discussion started by: linuxkid
17 Replies
7. Shell Programming and Scripting
I'm trying to do a script where I want to see if all users home directories are only writable by owner. However, in my script I do not know how to implement the for loop so that all directories are checked. In mine, I am only checking the permissions for the first directory found. I do know that a... (3 Replies)
Discussion started by: detatchedd
3 Replies
8. Shell Programming and Scripting
I have file named script1 as follows:
#!/bin/bash
count="0"
echo "hello"
echo "$count"
while
do
echo "$count"
count=`expr $count + 1`
done
-----------
when I run it, I get
./script1: line 9: syntax error near unexpected token `done'
./script1: line 9: `done'
I... (6 Replies)
Discussion started by: npatwardhan
6 Replies
9. Shell Programming and Scripting
Hi,
I want to do a simple loop where I have one column of text in a file and I want the loop to read each line of the file and do a simple command.
The text file will be something like this:
hostname1
hostname2
hostname3
hostname4
I am using Bash and have already come up with this to... (1 Reply)
Discussion started by: BrewDudeBob
1 Replies
10. Shell Programming and Scripting
Hi,
I'm having a problem with the while loop in bash. I try the following script:
#!/bin/bash
while true
do
echo "test"
done
When I try this, it gives me this error:
while: Too few arguments.
What am I doing wrong?
Thanks (5 Replies)
Discussion started by: Kweekwom
5 Replies