10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm trying to use a bash script for a psych experiment that involves listening to sound files and responding. If I have something like the code below, how can I make sure that a key press is assigned to RESPONSE only after the second echo statement?
for i in 1 2 3; do
echo "Ready?"
sleep 2
... (10 Replies)
Discussion started by: darwin_886
10 Replies
2. Shell Programming and Scripting
I am trying to allow a user to enter in text and then store that text in a variable $gene to run in an awk command in which those values are used to run some calculations. I am getting syntax errors however, when I try. Thank you :).
The awk runs great if it is a pre-defined file that is used,... (7 Replies)
Discussion started by: cmccabe
7 Replies
3. UNIX for Dummies Questions & Answers
The (longer) script that I am working on does something like this:
#!/bin/bash
while true
do
clear
sleep 1
shuf -i1-2 -n1
sleep .1
clear
echo "Press 1 if you saw a 1. Press 2 if you saw a 2."
read -s -n1 RESPONSE
done
If the user accidentally presses two... (1 Reply)
Discussion started by: darwin_886
1 Replies
4. Shell Programming and Scripting
$Input_filename=$ARGV;
if (!-d $Input_filename && ! -e $Input_filename)
{
print "USAGE: Please enter '$ABCD/def/dsed.txt' as an arguement \n";
exit;
}
1. Input Is suppose to be something like "$ABCD/def/dsed.txt".
if the input is wrong the script should throw an ERROR message.... (2 Replies)
Discussion started by: Rashid Khan
2 Replies
5. Shell Programming and Scripting
Hi,
The user inputs either "/tmp/bea" or "/tmp/bea/". Regardless my script should extract and store in a variable the last directory in the user input path.
Desired output: "bea"
Please help. (6 Replies)
Discussion started by: mohtashims
6 Replies
6. Shell Programming and Scripting
Hi,
I need my script to check if the user enters 3 values if not 5 values to my script and alert if the input has any other number of values.
for example:
./myscript.sh 22 56 3221 - > correct
./myscript.sh 22 56 3221 45 777 -> correct
./myscript.sh 22 56 3221 45 -> incorrect
Please... (6 Replies)
Discussion started by: mohtashims
6 Replies
7. Shell Programming and Scripting
i have a script which takes input from user, if user gives either Y/y then it should continue, else it should quit by displaying user cancelled.
#!/bin/sh
echo " Enter your choice to continue y/Y OR n/N to quit "
read A
if
then
echo " user requested to continue "
##some commands... (7 Replies)
Discussion started by: only4satish
7 Replies
8. Shell Programming and Scripting
Hi,
echo "Enter file name of input file list along with absolute path : "
read inputFileList
if
then
for string in `cat inputFileList`
do
echo $string
done
else
echo " file does not exist"
fi
From the above code, if the user enters a invalid file... (1 Reply)
Discussion started by: i.srini89
1 Replies
9. UNIX for Dummies Questions & Answers
how would i accept user input from the keyboard? (2 Replies)
Discussion started by: JamieMurry
2 Replies
10. Shell Programming and Scripting
I am trying write a script that takes user input date in the format "Mar 18". If it is march1 it is like "Mar 1" . Once i take this input i will go back to my log files and search for any failed transactions recorded that day. If there are then i will send it to a file and mail it.
I am... (10 Replies)
Discussion started by: gundu
10 Replies