The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Zenity Menu aspire Shell Programming and Scripting 4 07-08-2009 03:20 PM
zenity --question help ruben.rodrigues UNIX for Dummies Questions & Answers 3 03-25-2009 03:36 AM
View an html page inside zenity aspire Shell Programming and Scripting 0 03-23-2009 09:41 AM
Zenity ruben.rodrigues Shell Programming and Scripting 2 03-03-2009 08:33 AM
Zenity 2.20.1 (Default branch) iBot Software Releases - RSS News 0 12-31-2007 04:40 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-11-2009
dplate07
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
Zenity and IF/ELSE cond'.

Hey guys i wrote this code but it wont give me anything.

any ideas?

ans=$(zenity --list --text "Do you want to set USER/GROUP quota?" --radiolist --column "Choice" --column "Desc" TRUE Hi FALSE Bye); echo $ans


if [ "$ans" = 0 ]; then
./example.sh
else
exit
fi
  #2 (permalink)  
Old 07-11-2009
kshji's Avatar
kshji kshji is offline
Registered User
  
 

Join Date: Jun 2009
Location: Finland
Posts: 236
What do you like to do ?
It looks that zenity give some output to stdout and then you test if stdout data is "0" then you will execute some scipt ?

Or are you testing that ans is nothing ?

give the output of zenity command, easier to give solution.
Code:
# if value is empty, then you need to test it 
if [ "$ans" = "" ]; then
   ./example.sh
fi
or sortly same command line
Code:
[ "$ans" = "" ] && ./example.sh
  #3 (permalink)  
Old 07-11-2009
dplate07
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
As in the zenity radiolist, there is true and false. i assume that true is 0, as i dont really know the format of zenity. so thus if i choose the first choice then it will be true, and the $ans will be equals to one...

therefore, what im trying to say is i want to make the script to execute what the user selects, in this case is choice 1.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0