Sponsored Content
Full Discussion: conditional confusion
Top Forums Shell Programming and Scripting conditional confusion Post 302537013 by Corona688 on Wednesday 6th of July 2011 11:32:35 PM
Old 07-07-2011
Oh, I see. You want yad to happen BEFORE your function finishes.

---------- Post updated at 09:16 PM ---------- Previous update was at 09:12 PM ----------

I don't think you can use a yad progress bar AND have yad accept text input at the same time -- how could it tell the difference between the two? Would a text progressbar do?

You don't see to be using yad for anything but displaying text anyway, so why use yad at all?

---------- Post updated at 09:32 PM ---------- Previous update was at 09:16 PM ----------

you could run a separate instance of yad...


Code:
touch /tmp/$$
# echo 1 to start it throbbing
# sleep until the file is deleted, then echo 100 to make it close
# () & to make it run in the background
( ( echo 1 ; while [ -f /tmp/$$ ] ; do sleep 1 ; done ; echo 100 ) | yad --progress --pulsate --auto-close --no-buttons ) &

some_long_command

rm /tmp/$$
wait # for the dialog made earlier to close

This User Gave Thanks to Corona688 For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ISO Confusion?

Hiya folks, Just a quick question. When I am ready to download Fedora core 4, do I need to download all 4 ISO files? Or just one, I think myself it would be all 4 but dont want to sit and wait around if I only need to download one. Also after downloading the Iso files, do I burn one file to one... (6 Replies)
Discussion started by: Mr_Pinky
6 Replies

2. UNIX for Dummies Questions & Answers

wc command confusion

Can somebody explain it to me that why wc gives more chars suppose Ab.txt have two lines qwer qasd then wc -c ab.txt will give 10.why not 8.okay may be it is taking count one for each line just in case but why echo "qwer"|wc -C gives 5. Ok with \c it is returning 4. :) (6 Replies)
Discussion started by: Dhruva
6 Replies

3. Shell Programming and Scripting

Sed confusion

Hello all, I am trying to delete all the lines in a particular file having a pattern. The problem is that it has special characters and for some reason is not doing the job. For eg. src_file /home/test/filelist.txt :xxxx:ogog /home/test/RCH/ogogogg /home/test/RYHUJ/HHHH... (3 Replies)
Discussion started by: alfredo123
3 Replies

4. Shell Programming and Scripting

Confusion over a small conditional script

Hi, I was going through a file containing hundreds of lines of codes having conditional statement written as: log() { echo $@ } num=$(/usr/bin/rsh <one_machine> -l root 'ls -d /home/user/db* 2> /dev/null' | wc -w) (( num > 0 )) && log "db info:" so,if here the return value(stored in... (2 Replies)
Discussion started by: amit4g
2 Replies

5. UNIX for Dummies Questions & Answers

'tr' confusion

Good day, everyone! Could anybody explain me the following situation. If I'm running similar script: Var="anna.kurnikova" Var2="Anna Kurn" echo $Var | tr -t "$Var" "$Var2" Why the output is : anna KurniKova instead of Anna Kurnikova? :confused: Thank you in advance for any... (2 Replies)
Discussion started by: Nafanja
2 Replies

6. Homework & Coursework Questions

Server Confusion

I don't even know where to start with this one. There is so much out there about different aspects of this. I am starting with a basic Ubuntu 11.04 install. Do I need to configure a DNS? I am a little confused about that. What do I need to do for a domain name? I have followed various tutorials,... (1 Reply)
Discussion started by: polyglot0727
1 Replies

7. Shell Programming and Scripting

Confusion with PS

Hello All, I have a problem in counting number of process getting run with my current script name.. Here it is ps -ef | grep $0 | grep -v grep This display just one line with the PID, PPID and other details when i print it in the script. But when I want to count the numbers in my... (11 Replies)
Discussion started by: sathyaonnuix
11 Replies

8. UNIX for Beginners Questions & Answers

sed confusion

#!/bin/bash X=(0 2 4 6 7 0 0 0 0) Let me just say from the start that sed confuses the hell out of me! In the above line of code how can I use sed to remove all of the 0's except the first one? I have tried sed -e 's/*$//g' but it removes all of the 0's. Thank you in advance for any and... (3 Replies)
Discussion started by: cogiz
3 Replies

9. UNIX for Beginners Questions & Answers

If then statement confusion

#!/bin/bash PH=(KD 6S TC 3D) #playerhand TCIP=(AH) #topcard in play A=( "${TCIP::1}" ) # A B=( "${TCIP:1}" ) # H C=8 for e in ${PH}; do if ]; then echo "$e " >> /home/cogiz/validcards.txt else echo... (1 Reply)
Discussion started by: cogiz
1 Replies
GXMESSAGE(1)															      GXMESSAGE(1)

NAME
gxmessage - a GTK-based xmessage clone SYNOPSIS
gxmessage [OPTIONS] message ... gxmessage [OPTIONS] -file FILENAME DESCRIPTION
gxmessage opens a window to display a message obtained from the command line, from a file, or from stdin. The window includes a row of but- tons, each of which causes the program to exit with a different return code. The GNU Info entry for gxmessage contains detailed information and examples. OPTIONS
gxmessage should accept any option xmessage would, although some (such as -bw and -xrm) are silently ignored. Options supported by gxmes- sage are as follows: -bg COLOR Sets the background color of the message to COLOR. Examples: red, "#c90", "#446a7e". -borderless Opens the gxmessage window without the usual window frame. This option is not compatible with xmessage. -buttons BUTTON_LIST Defines the buttons to be created. BUTTON_LIST is a comma-separated list of LABEL:VALUE pairs, one for each button. The LABEL is the text that appears on the button. The VALUE (0..255) is the code the program will exit with if that button is pressed. Commas and colons can be escaped using backslashes (). As well as ordinary text, the LABEL can specify a GTK "stock" button, like "GTK_STOCK_CANCEL", or it can include an underscore (_) to specify a keyboard accelerator. If VALUEs are omitted, they default to 101, 102, 103, etc., in order. If no -buttons option is given, BUTTON_LIST defaults to "okay:0". gxmessage -buttons "Foo:42,Bar:63" "Example" echo $? gxmessage -buttons "_Foo,_Bar" "Example" echo $? gxmessage "Example" echo $? gxmessage -buttons "GTK_STOCK_OK:0" "Example" echo $? gxmessage -buttons "Hello, world" "Example" -center Opens the gxmessage window in the middle of the screen. -default LABEL Opens the gxmessage window with input focused on the specified button. LABEL is one of the LABELs in BUTTON_LIST (see -buttons, above). -display DISPLAY Specifies the X display to use. -encoding CHARSET Specifies the encoding of the message text. By default, the message text is assumed to match the encoding of the current locale. This option is not compatible with xmessage. -entry Adds a text entry box to the gxmessage window. When the window closes, any text in the entry box will be copied to stdout. This option is not compatible with xmessage and can't be used at the same time as the -print option. -entrytext TEXT Same as -entry, but sets the default entry box contents to TEXT. This option is not compatible with xmessage. -fg COLOR Sets the message text color to COLOR. -file FILENAME Causes the named file to be used as the message source. If a dash (-) is used in place of FILENAME, the message will be read from stdin. -fn | -font FONT Specifies the message font, using GTK2's font specification system. For example, -font "serif italic 14". (GTK2's font system is not compatible with xmessage. See the Compatibility section, below, for a workaround.) -geometry GEOMETRY Sets the window's size (position is ignored by gxmessage). Example: -geometry 400x200 -help Displays basic usage information then exits. -iconic Opens the gxmessage window in its iconized (minimized) state. -name NAME Sets the gxmessage window's name to NAME. -nearmouse Opens the gxmessage window near the mouse pointer. -noescape Prevents the window closing if the ESC key is pressed. This option only works if a file named /usr/share/gxmessage/allow_noescape exists. This option is not compatible with xmessage. -nofocus Prevents the gxmessage window from receiving focus when it opens. This option is not compatible with xmessage. -ontop Attempts to keep the gxmessage window in front of other windows. This option is not compatible with xmessage. -print Writes the LABEL of the selected button to stdout. -sticky Causes the gxmessage window to appear on all workspaces. This option is not compatible with xmessage. -timeout SECONDS Automatically closes the gxmessage window with an exit code of 0 if no button is pressed within SECONDS seconds. (The -entry and -entrytext options cause -timeout to be ignored.) -title TITLE Sets the gxmessage window's title to TITLE. -version Displays the program's version number and Copyright details, then exits. This option is not compatible with xmessage. -wrap Causes lines to wrap rather than exceed the width of the window. This option is not compatible with xmessage. GTK DEFAULTS
The program's default appearance can be adjusted using GTK resource files. The main text display widget is named gxmessage-textview. The text entry widget is named gxmessage-entry. # Example: ~/.gtkrc-2.0 style "gxmsg" { text[NORMAL] = "#cc9900" base[NORMAL] = "#660000" text[SELECTED] = "#660000" base[SELECTED] = "#cc9900" font_name = "monospace" } widget "*.gxmessage-textview" style "gxmsg" widget "*.gxmessage-entry" style "gxmsg" EXIT STATUS
If a button is pressed, the program returns the value assigned to that button. The default "okay" button returns 0. If a timeout event occurs, the program returns 0. If an error occurs, or if the window is closed without a button-press or timeout event, the program exits with code 1. Pressing the ESC key also causes the program to exit with code 1. COMPATIBILITY WITH XMESSAGE
Fall back to xmessage if gxmessage isn't available: #! /bin/sh XMESSAGE=$(which gxmessage) || XMESSAGE=xmessage $XMESSAGE "hello, world" If you specify fonts, check which program you're using: font="monospace 14" [ "$XMESSAGE" = xmessage ] && font="fixed" $XMESSAGE ${font:+-fn "$font"} "hello, world" Don't use double-dashed command line options: $XMESSAGE "hello, world" -buttons good $XMESSAGE "hello, world" --buttons bad Don't use the gxmessage-specific options: -entry, -entrytext, -borderless, -wrap, -encoding, -nofocus, -noescape, -ontop, -sticky, -version, -h, -? BUGS
The position component of -geometry values is ignored by gxmessage. For some reason, opening the gxmessage window with no button set to be the default causes GTK to emit a "beep" sound. If you discover other bugs in the most recent version of gxmessage, please get in touch. SEE ALSO
xmessage(1), zenity(1), dialog(1) The GNU Info entry for gxmessage contains detailed information and examples. AUTHORS
Timothy Musson <trmusson@gmail.com> COPYRIGHT NOTICE
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Timothy Richard Musson Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this notice are pre- served. February 25th, 2012 GXMESSAGE(1)
All times are GMT -4. The time now is 08:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy