I am trying to create a shell (ksh) which has two "read" commands, one which reads a line from a file and another which is inside a loop that reads user input from a keyboard. However, the "read" command inside the loop uses the input from the file and it does not get the user input from keyboard.... (3 Replies)
Hello all,
How can i have a user input that reads like this:
echo -n "Please enter a & b:" 10 20
read a
read b
echo $a
echo $b
10
20
right now i have divided it into two echos, like
echo -n "a: "
echo -n "b: " (1 Reply)
I'm trying to set up a script that takes user input and validates that the user input was entered correctly.
So far I have this:
while :
do
echo "Please enter your name."
read NAME
if
then
echo "You have not entered a name."
echo... (13 Replies)
If I want all user input to start with " : " if not display error
or what I asking is how to do if statement that control a first letter of string that we want to start with. and not worry about the rest
Thank (1 Reply)
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)
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)
$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)
Why does removing "rhgb quiet" from the kernel boot parameters control whether or not the commands I enter are displayed in single user mode ?
For instance, if I do not remove "rhgb quiet", when I am in single user mode, whatever command I type will not be displayed on the screen.
The... (0 Replies)
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
LEARN ABOUT REDHAT
upslog
UPSLOG(8) Network UPS Tools (NUT) UPSLOG(8)NAME
upslog - UPS status logger
SYNOPSIS
upslog -h
upslog ups logfile interval [format]
DESCRIPTION
upslog is a daemon that will poll a UPS at periodic intervals, fetch the variables that interest you, format them, and write them to a
file.
The default format string includes variables that are supported by many common UPS models. See the description below to make your own.
OPTIONS -h Display the help message.
ups Monitor this UPS. The format for this option is [upsname@]hostname[:port].
logfile
Store the results in this file.
You can use - for stdout, but upslog will remain in the foreground.
interval
Wait this many seconds between polls.
Remember that a poll is not instantaneous, so it will slip back as the program runs. If you require tighter timing, you should
write your own logger using the upsclient library.
format The string to log, including variables from the UPS. Valid escapes within this string are:
%% - insert a single %
%TIME format% - insert the time with strftime formatting
%ETIME% - insert the number of seconds, ala time_t. This is now a 10 digit number.
%HOST% - insert the local hostname
%UPSHOST% - insert the host of the UPS being monitored
%PID% - insert the pid of upslog
%VAR varname% - insert the value of variable varname
The default format string is:
%TIME @Y@m@d @H@M@S% %VAR battpct% %VAR utility% %VAR loadpct% [%VAR status%] %VAR upstemp% %VAR acfreq%
SERVICE DELAYS
The interval value is merely the number given to sleep() after running through the format string. Therefore, a query will actually take
slightly longer than the interval depending on the speed of your system.
LOG ROTATION
upslog writes its pid to upslog.pid, and will reopen the log file if you send it a SIGHUP. This allows it to keep running when the log is
rotated by an external program.
SEE ALSO
Server:
upsd(8)
Clients:
upsc(8), upscmd(8), upsrw(8), upsmon(8)
Internet resources:
The NUT (Network UPS Tools) home page: http://www.exploits.org/nut/
NUT mailing list archives and information: http://lists.exploits.org/
Wed Oct 16 2002 UPSLOG(8)