please read my sample script for move files
script will ask user to start movement(read command) if he does't then it sholud clear the screen and run script in while
if i do not give any input for 5 sconds then it sholud clear the script and as on
while true
do
if test [ "$yes_no" = 'Y' -o "$yes_no" = 'y' -o "$yes_no" = 'N' -o "$yes_no" = 'n' ]
You are running 'test test'; [ is the same command as 'test'.
See below for a beter way.
Quote:
then
if test $yes_no = Y -o $yes_no = y
then
echo movement started
fi
if test $yes_no = N -o $yes_no = n
then
echo movement stopped
fi
fi
echo movement is not running
echo " DO you want to continue for movement [ Y/y or N/n ]: \c "
read yes_no
echo $yes_no
sleep 5
clear
done
Quote:
is this posible
read yes_no|sleep 5
sleep 5 | read yse_no
[/QUOTE]
If you are using bash, there is a -t option to read.
Hi, i facing a problem when run the script below..
while
do
if
then
printf "Please enter a name : "
read response # the problem occur here
if
then
ea_ident=${omc_ident}
else
#
# Check that name does not contain invalid... (14 Replies)
Solaris 10
Korn shell ksh,
Hi there,
I have figured out to get yesterday's date which is using the below command:
TZ=GMT+24; date +%d-%b-%Y to get the format of 30-Sep-2008 and
TZ=GMT+24; date +%Y%m%d to get the format of 20080930.
I need this two format. In my perl script below I need... (4 Replies)
Hello All,
I have a an application written in C and runing on Red Hat Linux.
In my code I have written a command that is fired on the linux shell by using system() function call.
Now I need to read the output of this command in my c program and assign it to a variable.
Can anyone... (1 Reply)
Hi All,
I wish to automate the unix command 'su' through a shell script.
I would like to pass the content of a file as password to 'su' command.
My script is as below,
#! /bin/sh
su userA
while read line
do
rpm -ivh $line
done < pwd.txt
where pwd.txt contains the password of... (6 Replies)
Hey experts,
I am trying to read a webpage and want to search for a text patter (case insensitive). Please help me acquire this.
If the text is found i will receive a mail which can be hardcoded in the script.
I am not a big fan of using PERL script.
Please help.
Machine: AIX... (15 Replies)
hi all,
i have to read a file using shell script for example my csv file is
like this
Tid Inputfille Inputfilepath
1 ABC_20141218.idr /export/home/him60t1/input
2 ABC_20141219.idr /export/home/him60t1/input1
what i have to do is if on my command line i... (1 Reply)
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk... (2 Replies)
I want to write a script that read the input to variable.
I want the input screen to have 2 lines, where the values already input will appear above the input line
for example if I want to input the words below:
like
love
live
life
The screen will display like this:
1. Before any input... (8 Replies)
Hi,
i am working on one automation , for that i have writing one shell program that take user input in "while read line" block. but read command is taking value that is readed by While block.
while read line; do
command 1;
command 2
echo -n "Do you want to continute > "
read rsp... (2 Replies)