03-17-2009
Exit script if the user dosent enter any data within 5 seconds
Hello friends,
Kindly help me in developing a script that asks user to enter a value and will wait for 5 seconds for the feedback. If there is no answer from the user the script will perform exit or it will continue doing something else
Ex: If yu have a multi OS system i believe while starting it will ask which one to boot and will wait for 30 seconds. The data about how much time remaining will also be dynamically displayed somewhere near to it.
Expected Output 1:
Do you want to continue (y/n) ?
Remaining seconds: 5
if the above is not possible, this one will count in background
Expected Output 2:
Do you want to continue (y/n) ?
the Remaining seconds will be updated dynamically. if this is not possible atleast the script should count in background.
Thanks.
10 More Discussions You Might Find Interesting
1. Programming
If I have a "Hello World" function (just prints that) and a similar "Goodbye World" function... is there a way (maybe a compiler option?) that I can get them to be executed directly as the absolute first and last things run in every function call.
So for example, the following code:
int foo()... (5 Replies)
Discussion started by: jjinno
5 Replies
2. Shell Programming and Scripting
#!/usr/bin/bash
###script to input four characters. wxyz
echo "input first string"
read instring1
echo "input second string"
read instring2
##
echo "first string is:" $instring1
echo "second string is:" $instring2
##IF instring1 or instring2 are NOT 4 characters (xxxx) , exit 1.
##how??
... (2 Replies)
Discussion started by: ajp7701
2 Replies
3. Shell Programming and Scripting
guys I need emergency help with below shell script assignment..am new to shell script
Write a Shell script to automatically check that a specified user is logged in to the
computer.
The program should allow the person running the script to specify the name of the
user to be checked, the... (2 Replies)
Discussion started by: gurmad
2 Replies
4. Shell Programming and Scripting
The script prompts the user to enter four lines. (1 Reply)
Discussion started by: polineni
1 Replies
5. UNIX for Dummies Questions & Answers
I am a quite newbie on UNIX SCRIPTING...Please help me solving this two questions...
1st Question;
I want to create one command that will run a script when anyone use that command on that server... I mean, in the prompt if I put my name 'Rony' it will execute a script called 'rony.sh'. How can... (1 Reply)
Discussion started by: Rony-123
1 Replies
6. Shell Programming and Scripting
Hi,
Can anyone help me how to exit a shell script if a unix command inside does not return any value for 10 seconds?
The scenarios is like this.
I want to login to a application using shell script where the connection string is mentioned.but suppose this connection string is not... (10 Replies)
Discussion started by: arijitsaha
10 Replies
7. Shell Programming and Scripting
Hi All
I have a script that moves files from one dir to another dir based on date, but I would like to change it in a way that whoever is going to run to enter the dates in which files will be removed. This is my script:
#!/bin/sh
touch -mt 201302250000 /tmp/ref3
touch -mt 201302282359... (14 Replies)
Discussion started by: fretagi
14 Replies
8. Ubuntu
I'm writing a bunch of scripts to automatically configure Ubuntu and I want to run the code below to remove the white dots from the login screen:
sudo xhost +SI:localuser:lightdm
sudo su lightdm -s /bin/bash
gsettings set com.canonical.unity-greeter draw-grid false
The problem is that... (3 Replies)
Discussion started by: maerlyngb
3 Replies
9. Shell Programming and Scripting
Hello all..
so i have a problem i need to solve ..
#! /bin/bash
$SHELL
dtterm -title my_prog -e su -user -c 'export DISPLAY=:0.0 ; /path/to/my/prog' & 2> /dev/null
$SHELL
intr
exit
This script will work on solaris 10 system in right clikt menu - in a secure system so i need to... (0 Replies)
Discussion started by: defs
0 Replies
10. Shell Programming and Scripting
Hi everyone, I'm new here and just a beginner in linux scripting.
Just want to ask for help on this one.
I am trying to create a script that will accept user input (year-month and user/s).
I wanted to have the script to continue running, until the user inputs a DATE and name/s of user/s. ... (2 Replies)
Discussion started by: Helskadi
2 Replies
LEARN ABOUT LINUX
rmcpping
RMCPING(8) System Manager Commands RMCPING(8)
NAME
rmcpping - send RMCP Ping to network hosts
SYNOPSIS
rmcpping [OPTION...] destination
DESCRIPTION
rmcpping uses the RMCP Ping request datagram to elicit an RMCP Pong response from a remote host. The utility can be used to verify if a
remote host supports RMCP or IPMI. The initial starting sequence number will be randomized. rmcpping will return 0 to the environment if
it receives atleast 1 response from the remote host. Otherwise, it exits with a value of 1.
OPTIONS
The following options are available
-h Output help menu.
-V Output version.
-c count
Stop after sending count packets.
-i interval
Wait interval seconds between sending each packet. The default is to wait for one second between each packet.
-I interface address
Set source address to specified interface address. Argument may be numeric IP address or name of device.
-t timeout
Time to wait for a response, in seconds. Default is five seconds.
-v Verbose output.
-s num Specify an initial starting sequence number. The default is to use a random initial sequence number.
-d Turn on debugging.
KNOWN ISSUES
It has been observed that some remote BMCs can get "confused" and delay packet responses if duplicate packets (with duplicate sequence num-
bers) are sent in succession very quickly. There is no known way to cleanly deal with a "confused" BMC other than the wait awhile.
Unlike ping(8), local network devicess (e.g. 127.0.0.1) cannot be "pinged".
REPORTING BUGS
Report bugs to <freeipmi-users@gnu.org> or <freeipmi-devel@gnu.org>.
COPYRIGHT
Copyright (C) 2007-2012 Lawrence Livermore National Security, LLC.
Copyright (C) 2003-2007 The Regents of the University of California.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
ORIGIN
Command and manpage based off ping(8).
SEE ALSO
freeipmi(7), ping(8), ipmiping(8)
http://www.gnu.org/software/freeipmi/
rmcpping 1.1.5 2012-06-15 RMCPING(8)