Sponsored Content
Full Discussion: countdown in unix?
Top Forums UNIX for Dummies Questions & Answers countdown in unix? Post 302310044 by methyl on Thursday 23rd of April 2009 02:22:46 PM
Old 04-23-2009
An example. Depends on what shell you have.

Code:
#/bin/ksh
countdown=10
while [[ ${countdown} -ge 0 ]]
do
        echo ${countdown}
        sleep 1
        countdown=$(( ${countdown} - 1 ))
done

 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

shell script - loop to countdown

I am taking a class in UNIX and have written a script that needs to countdown from a number that is read in from the keyboard to zero. If no number is given the start of the countdown should default to 10. I can't get this to do the default #! /bin/sh echo Enter a number here to countdown... (2 Replies)
Discussion started by: froggwife
2 Replies

2. Shell Programming and Scripting

countdown to christmas

was wondering if there was a script that would countdiwn the days until christmas (3 Replies)
Discussion started by: trob
3 Replies

3. Shell Programming and Scripting

Stop! (the countdown!) :-) shell script help

Hi guys, I've found two nifty little scripts on these forums one which detects if the F5 key has been pressed: #/bin/sh _key() { local kp ESC=$'\e' _KEY= read -d '' -sn1 _KEY case $_KEY in "$ESC") while read -d '' -sn1 -t1 kp do _KEY=$_KEY$kp ... (0 Replies)
Discussion started by: rich@ardz
0 Replies

4. Shell Programming and Scripting

Anyone know of any FUN countdown script

Hi all, Does anyone know of any FUN countdown script that I can use for my script? At the moment, am just using sleep 10 or more and then print stuff into the screen to allow more time for the user to decide whether they want to continue running the script or abort? Just thought of wanting... (3 Replies)
Discussion started by: newbie_01
3 Replies

5. Shell Programming and Scripting

Bash - countdown timer

Hello, I have another problem with my script - I would like to have a countdown timer visible on the screen, and at the same time, I want te be able to do something else. And when the time runs out, I need to know about that inside the script somehow and do some action. I guess that would require 2... (3 Replies)
Discussion started by: xqwzts
3 Replies

6. Shell Programming and Scripting

Perl script countdown

In the below bash when the perl is it possible to hide the commands from running on screen and display a process countdown? For example, on the cygwin screen now the user sees each process in the command running as running protocol refGene, running protocol popfreq_all, etc... Could a... (0 Replies)
Discussion started by: cmccabe
0 Replies

7. Ubuntu

Countdown timer with seconds

I would like this to work with seconds as well. #!/bin/bash # if ; then echo "Incorrect usage ! Example:" echo './CountDown.sh -d "Jun 10 2011 16:06"' echo 'or' echo './CountDown.sh -m 90' exit 1 fi now=`date +%s` if ; then until=`date -d... (7 Replies)
Discussion started by: drew77
7 Replies

8. UNIX for Beginners Questions & Answers

Banner Countdown Timer

Hello. I am pretty new to unix and shell scripting and I was wondering if there might be a way to banner a countdown timer inside a script. We currently have an existing script that does a 2 minute sleep but thought it might be fun to actually make it banner a countdown timer until it is finished.... (3 Replies)
Discussion started by: thumbelina
3 Replies
dxshutdown(8)						      System Manager's Manual						     dxshutdown(8)

NAME
dxshutdown - Performs various types of automated system shutdown. SYNOPSIS
/usr/bin/X11/dxshutdown OPTIONS
The dxshutdown command accepts all of the standard X Toolkit command-line options, which are documented in the OPTIONS section of the X(1X) reference page. DESCRIPTION
The Shutdown Manager application, dxshutdown, provides the system administrator with a graphical user interface for running user-specified scripts at shutdown time in addition to performing the following types of automated system shutdown: Halt (and restart console mode) Reboot Single-user mode shutdown Message-only shutdown Dependencies: None. You do not need to configure anything prior to running Shutdown Manager. You must be root to run Shutdown Manager. Shutdown Manager also lets the system administrator display one or more warning messages prior to system shutdown. The dxshutdown command uses the Tru64 UNIX shutdown command as an API, passing command-line arguments as specified by application defaults and user inputs. The Shutdown Manager also provides the following features, which the shutdown command does not provide: Selection of a preshutdown script to be executed prior to system shutdown Easy cancellation for a shutdown while the timed countdown is in progress Maintenance of an error- and-script output log under /var/adm/sysman/dxshutdown.log Saving and restoring user-selected shutdown options over multiple invocations of the Shutdown Manager application For additional information about the graphical user interface, see the online help volume, which is available from the Help button in the main window of the Shutdown Manager application. To start dxshutdown from the graphical user interface: Click on the Application Manager icon on the CDE front panel. Double click on the System_Admin application group icon. Double click on the Daily Admin application group icon. Double click on the Shutdown Manager appli- cation icon. EXAMPLES
To start Shutdown Manager from the command line, enter: dxshutdown To open the Shutdown Manager help volume from the command line, enter the following command: /usr/dt/bin/dthelpview -h /usr/dt/appconfig/help/C/DXshutdown.sdl FILES
Shutdown Manager executable Shutdown Manager log file Shutdown Manager help volume Shutdown Manager resource file (for option settings) SEE ALSO
Commands: fasthalt(8), halt(8), rc0(8), reboot(8), rwalld(8), shutdown(8), sync(8), X(1X) dxshutdown(8)
All times are GMT -4. The time now is 04:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy