10 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
Hello
I would like to write a bash shell script which will need user to supply one variable which is mandatory and some other optional variables. If mandatory variable is not supplied by user, the script will exit. If optional values are not supplied by user, hard-coded value (in the script)... (3 Replies)
Discussion started by: atanubanerji
3 Replies
4. Shell Programming and Scripting
I have a bash loop that waits for a single key press, then does $something depending on what $key is pressed before refreshing the screen with updated data. The problem I have is that the script will store additional key presses and chain them together causing the screen to redraw and the script... (1 Reply)
Discussion started by: DarkPhoenix
1 Replies
5. Shell Programming and Scripting
Hi, I have written a script that allows me to repetitively play a music file $N times, which is specified through user input. However, if I want to exit the script before it has finished looping $N times, if I use CTRL+c, I have to CTRL+c however many times are left in order to complete the loop.... (9 Replies)
Discussion started by: hilltop_yodeler
9 Replies
6. 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
7. Shell Programming and Scripting
Dear mentors, I just need little explanation regarding for loop to give input to awk script
for file in `ls *.txt |sort -t"_" -k2n,2`; do
awk script $file
done
which sorts file in order, and will input one after another file in order to awk script
suppose if I have to input 2 or... (4 Replies)
Discussion started by: Akshay Hegde
4 Replies
8. 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
9. 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
10. UNIX for Dummies Questions & Answers
I have multiple input files that I want to manipulate using a shell script. The files are called 250.1 through 250.1000 but I only want the script to manipulate 250.300 through 250.1000. Before I was using the following script to manipulate the text files:
for i in 250.*; do
|| awk... (4 Replies)
Discussion started by: evelibertine
4 Replies