Sponsored Content
Top Forums Shell Programming and Scripting Bash script [Press Tab] Screen Blank.. Post 302379954 by carnegiex on Sunday 13th of December 2009 04:10:23 PM
Old 12-13-2009
Bash script [Press Tab] Screen Blank..

Dear Member,

OLD Question --> disable-completion not solved

My bash Menu script ping process problem.
If ping still running and users press [Tab Key] SCREEN is Blank...

Cant Members help me.. kill signal [Tab Key] or others scripting for my case, btw i use Linux..

Thanks,
Rico

My Bash Script :

Code:
#!/bin/bash

declare -r DIALOG_OPTS="0 0 0"
declare -i -r OUTPUT_DIALOG_WIDTH=60

pipe_command_to_tailbox_dialog() {
        local -i height=5+$1; shift
        local title="$1"; shift
        local command="$1"; shift

        local output_file=`mktemp`
        (eval $command) >& $output_file &
        local -i bg_job=$!

        dialog --title "$title" --tailbox $output_file $height $OUTPUT_DIALOG_WIDTH

        if [ -d /proc/$bg_job ]; then
    kill $bg_job || kill -9 $bg_job >& /dev/null
        fi
        wait $bg_job
    rm -f $output_file
}

# pings a host with a nice dialog
ping_host_dialog() {
        local ping_params_tmp=`mktemp`
            if dialog --ok-label "Submit" \
               --form "Ping host" \
                $DIALOG_OPTS \
     "Address:" 1 1 "192.168.1.1" 1 30 40 0 2> $ping_params_tmp; then
     local address=`head -1 $ping_params_tmp | tail -1`
        fi
        rm -f $ping_params_tmp
        if [ x"$address" != x ]; then
     pipe_command_to_tailbox_dialog 15 "Pinging host \"$address\"" "ping \"$address\""
        fi
}

main() {
        ping_host_dialog;
}

main "$@"


Last edited by pludi; 12-13-2009 at 06:15 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to grep for blank records (space,tab,/n)?

I want to exclude (-v) blank records from a file before analysing it. I know I can use '^]$' for spaces and tabs but how do you look for lines that have nothing (/n or line feed) ? (2 Replies)
Discussion started by: Browser_ice
2 Replies

2. Solaris

Blank GRUB Screen

Hello. I had installed solaris 10 in morning , and all was running fine... I just logged out and logged in with another user ID oracle - It got stuck and then I pressed the button for restart. Now I see only word GRUB written in top line rest everything is black. What to do? (2 Replies)
Discussion started by: panchpan
2 Replies

3. Solaris

Blank screen on crt

Hello I'm new in sun and i have a liitle problem. I buy sun enterprise 420r and connect keyboard and monitor crt (non Sun). But when i start server i have blank screen on crt. I'm new in sun servers and i dont know why its doin this. (11 Replies)
Discussion started by: elmik
11 Replies

4. Shell Programming and Scripting

read -n1 -r -p "Press..." key / produces error in bash shell script

Hello! Sorry, for my not so perfect english! I want to stop bash shell script execution until any key is pressed. This line in a bash shell script read -n1 -r -p "Press any key to continue..." key produces this error When I run this from the command line usera@lynx:~$ read... (4 Replies)
Discussion started by: linuxinho
4 Replies

5. UNIX for Advanced & Expert Users

GNU screen: shortcut to go to tab 10,11 etc

Using GNU-Screen for a long time. C-a 1 2 n p to navigate to other tabs. This works till 9. I often have 10, 11 etc. Is there any way to go to them quickly ? Currently, i have to do C-a 9, C-a n which is quite a pain. Thanks. (0 Replies)
Discussion started by: sentinel
0 Replies

6. Shell Programming and Scripting

Press Any Key script sequence using bash - HELP

hi to all. im a newbie in unix shell scripts. i want to make a simple unix shell script using the bash shell that asks a user to press any key after a series of commands, or an x if he wishes to exit. here's a sample script that i made: #!/usr/bin/bash pause(){ /usr/bin/echo "\t\t Press... (3 Replies)
Discussion started by: booghaw
3 Replies

7. Solaris

Screen blank on boot up

I have a SunFire V490 Recently when the server is rebooted the screen goes blank from when the CDE is shutdown to when it is started up again. Has anyone got any ideas what might be causing this? I've had a quick look in messages but can't find anything in there. I've had a look at... (2 Replies)
Discussion started by: sonic72
2 Replies

8. Ubuntu

Blank screen after upgrade from 11.10 to 12.04!

Hello, I got blank screen when reboot after I tried to upgrade Ubuntu (64 bit server version) from 11.10 to 12.04 at update manager. The normal login GUI is missing, but mouse cursor is fine. Then I switched to terminal (tty1 ~ tty6), which looked fine and showed it is Ubuntu 12.04 ! (Forgot how... (4 Replies)
Discussion started by: yifangt
4 Replies

9. Shell Programming and Scripting

Dividing tab blocks in bash script

Hi everyone, I have a data.xml file which only contains thousands of data (tag) blocks. A part of the file looks exactly like this; <data> Line Line Line </data> <data> Line Line Line </data> the rest of the file is simply a repetition of this part. Here each data block contains a... (8 Replies)
Discussion started by: hayreter
8 Replies

10. Shell Programming and Scripting

How to replace blank tab with zero in a file?

hi, i need to replace a blank tab output in a file to zero. input file: 2015/08/04 00:00:00 171 730579 27088 <blank> 3823 30273 1621778 ... (6 Replies)
Discussion started by: amyt1234
6 Replies
MRTG-PING-PROBE(1)					      General Commands Manual						MRTG-PING-PROBE(1)

NAME
mrtg-ping-probe - ping probe module for Multi Router Traffic Grapher DESCRIPTION
mrtg-ping-probe is a ping probe module for MRTG 2.x. It is used to monitor the round trip time and packet loss to networked devices. MRTG uses the output of mrtg-ping-probe to generate graphs visualizing minimum and maximum round trip times or packet loss. mrtg-ping-probe is not run directly, but is called by MRTG as a helper when it needs to determine ping time to a host. Act responsibly: do not use mrtg-ping-probe to ping devices without the owner's permission. Just imagine if 10,000 people decided to ping your hosts! mrtg-ping-probe is meant to be used within your network to get round trip time performance figures for your network. OPTIONS
To use mrtg-ping-probe you need to configure MRTG to call it from within the definition of a target host. This is done in the MRTG config file, which is usually /etc/mrtg.conf. Here's an example snippet: change the target name and IP address to suit your needs. Target[your.target.ping]: `/usr/bin/mrtg-ping-probe 123.456.789.123` SetEnv[your.target.ping]: MRTG_INT_IP="123.456.789.123" MRTG_INT_DESCR="ping" MaxBytes[your.target.ping]: 100 AbsMax[your.target.ping]: 200 Options[your.target.ping]: gauge, growright YLegend[your.target.ping]: ping time (ms) ShortLegend[your.target.ping]: ms Legend1[your.target.ping]: Maximum Round Trip Time in ms Legend2[your.target.ping]: Minimum Round Trip Time in ms Legend3[your.target.ping]: Maximal 5 Minute Maximum Round Trip Time in ms Legend4[your.target.ping]: Maximal 5 Minute Minimum Round Trip Time in ms LegendI[your.target.ping]: &nbsp;Max: LegendO[your.target.ping]: &nbsp;Min: Pay close attention to the backticks in the first line which tell MRTG to execute the nominated external program. Note also that you need to use the "gauge" option, since the results of subsequent ping probes are independant values and not an incrementing counter. SEE ALSO
mrtg(1). The latest release of mrtg-ping-probe can be found on the web at http://pwo.de/projects/mrtg/ AUTHOR
This manual page was written by Jonathan Oxer <jon@debian.org>, for the Debian project (but may be used by others). April 14, 2003 MRTG-PING-PROBE(1)
All times are GMT -4. The time now is 07:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy