9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
when I try to redirect input and the command is described as a string within an array redirection does not work. why?
#!/bin/bash
dir=("tail < ./hello.txt")
tail < ./hello.txt #works
${dir} #does not work (2 Replies)
Discussion started by: heinzel
2 Replies
2. Shell Programming and Scripting
hello guys
i have bash script to open my routers with username and password
i made script but i have problem this script can/t read password from file
#!/bin/bash
router_file="ips"
passwd="password.txt"
for router in cat ;$router_file do
for pass in cat ;$passwd; do
res=$(curl -m 1 ... (7 Replies)
Discussion started by: manhoud
7 Replies
3. Shell Programming and Scripting
I have the following while loop that I put in a script, demo.sh:
while read rna; do
aawork=$(echo "${rna}" | sed -n -e 's/\(...\)\1 /gp' | sed -f rna.sed)
echo "$aawork" | sed 's/ //g'
echo "$aawork" | tr ' ' '\012' | sort | sed '/^$/d' | uniq -c | sed 's/*\(*\) \(.*\)/\2: \... (3 Replies)
Discussion started by: faizlo
3 Replies
4. Shell Programming and Scripting
I am looking for a way to start a script and have it prompt for a password that will be used later on in the script to SSH to another host and to SFTP. I don't want the password to be hard coded. Below is my script with the actual IP's and usernames removed.
#!/usr/bin/expect -f... (2 Replies)
Discussion started by: jbrass
2 Replies
5. UNIX for Dummies Questions & Answers
Hi Sir,
I am just learning bash scripting and I came across a challenge.
I need to input F11 to a script among many text inputs.
For all the text inputs i did following.
# sh test.sh < input.txt
where input.txt contains all the text inputs in new lines.
This worked fine until i... (1 Reply)
Discussion started by: gaurav kumar
1 Replies
6. Shell Programming and Scripting
I would create a bash script than parse like this:
test.sh -p (protocol) -i (address) -d (directory)
I need retrive the value after -p for example...
understand???
I hope...
thanks (6 Replies)
Discussion started by: ionral
6 Replies
7. Shell Programming and Scripting
Hi,
I have this script
Script.sh:
#!/bin/sh
sed 's,\,,g' input.dat > output .dat
But i want to run it witb different files. So i want the input file as an input argument to the script, how could i do that.
Running it like this:
> Script.sh input.dat (2 Replies)
Discussion started by: Johanni
2 Replies
8. Shell Programming and Scripting
Here is my script:
#!/bin/ksh
usage ()
{
echo " Usage: $0 <opt1> <opt2> <opt3> <opt4>"
}
if ; then
usage
exit;
fi
prog -a $1 -b $2 -c $3 -d $4 2>&1 | tee -a ~/$1.log
I want argument 4 to be optional, so if there's no argument for opt4, that it doesn't... (8 Replies)
Discussion started by: guitarscn
8 Replies
9. Shell Programming and Scripting
I have an awk script which can be used in the following ways:
xi and xf will only be mandatory when processing the file fin.zc.
awk -v xi=0/-0.5 -v xf=80/30 -f ./zc2cmd.awk fin.zc > fout.cmod
awk -f ./zc2cmd.awk -u
awk -f ./zc2cmd.awk --usg
awk -f ./zc2cmd.awk -e
awk -f ./zc2cmd.awk... (1 Reply)
Discussion started by: kristinu
1 Replies