Sponsored Content
Top Forums Shell Programming and Scripting Bin/bash - xmessage very slow Post 303001886 by mad-hatter on Sunday 13th of August 2017 05:29:17 PM
Old 08-13-2017
Bin/bash - xmessage very slow

Hello,

I am showing the start of my script.
I am finding that 'xmessage' is taking about 12-15 seconds to show.
This in a terminal is very quick '/opt/vc/bin/vcgencmd get_camera'.
Is there any way to get 'camera not detected' to show faster.

Regards
Code:
#!/bin/bash

s=$(/opt/vc/bin/vcgencmd get_camera)
sb="supported=1 detected=1"
case $sb in
$s)
echo "Camera detected"
;;
*)
xmessage "Camera not detected !" -buttons ok
exit 1
;;
esac

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

xmessage

i want to maximise the xmessage window?for that what i have to do? (1 Reply)
Discussion started by: lakshmananindia
1 Replies

2. Shell Programming and Scripting

#!/bin/bash has stopped working

Hi I'm writing a script and I've put #!/bin/bash as the first line so that I can just type my scripts name 'whodate' at PS1 instead of ./whodate. This has suddenly stopped working for me. It used to be the case that I could start a script with #!/bin/bash and it would work, but for this script... (2 Replies)
Discussion started by: zorrokan
2 Replies

3. Shell Programming and Scripting

/bin/bash - variable substitution.

Is it possible with a bash variable to perform multiple substitution strings to one variable? I have this variable: echo $clock TIMEZONE="US/Central" What I would like to do with bash only it pull out just the "US" part of the variable.. which could be any number of countries. this is... (6 Replies)
Discussion started by: trey85stang
6 Replies

4. Shell Programming and Scripting

Bash script too slow

I have a bash script that will take approx. 130 days to complete. I am trying to grep a list of 1,144 user ID's out of 41 (1 GB each) files. The 41 files were originally one 41 G file, but that was horrendously too slow.:eek: This is my current file: #!/bin/bash for i in `cat... (11 Replies)
Discussion started by: tigta09
11 Replies

5. Shell Programming and Scripting

BIN/BASH.

THANKS UNIX SYSTEM®.I was found my job from UNIX®.I USE MONKEY WRENCH WITH WARTER.I am now studying my studio with UNIX SYSTEM®. THANKS UNIX SYSTEM®. THANKS OUR OPEN GROUP. from Takayasu Sakashita.My name is Takayasu Sakashita. I respect you. Austin.PEACE!Bey bey. Your friend TAKA.Good... (1 Reply)
Discussion started by: administrator®
1 Replies

6. Shell Programming and Scripting

bin bash decimal compare

I need decimal comparing with if. Check if apache version is less than 2.2.17. I tried this and not working. #!/bin/bash apachever=`/usr/local/apache/bin/httpd -v | head -1 | awk '{print $3}' |cut -d/ -f 2` if ]; then echo "Apache version less than 2.2.17" else ... (7 Replies)
Discussion started by: anil510
7 Replies

7. Shell Programming and Scripting

/bin/bash: Event not found.

Hi I'm new to scripting - please help me... I'm trying to run a script written by a friend: #!/bin/bash for aStat in .... do .... done when coping the script to the terminal I get: /bin/bash: Event not found. for: Command not found. (7 Replies)
Discussion started by: atira
7 Replies

8. Shell Programming and Scripting

BASH Slow Under Cron Only!

I've got a BASH script that runs much faster from the command line than when invoked under CRON. Ideas? Priority? IO? (1 Reply)
Discussion started by: gmark99
1 Replies

9. Shell Programming and Scripting

Usage of #!/bin/sh vs #!/bin/bash shell scripts?

Some question about the usage of shell scripts: 1.) Are the commands of the base shell scripts a subset of bash commands? 2.) Assume I got a long, long script WITHOUT the first line. How can I find out if the script was originally designed für "sh" or "bash"? 3.) How can I check a given... (3 Replies)
Discussion started by: pstein
3 Replies

10. UNIX for Beginners Questions & Answers

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed ? Is there any way to get the script names for the process command ? --- Post updated at 08:39 AM --- in KSH (Korn Shell), my command output shows the script names but when run in the Bash Shell... (3 Replies)
Discussion started by: i4ismail
3 Replies
XMESSAGE(1)						      General Commands Manual						       XMESSAGE(1)

NAME
xmessage - display a message or query in a window (X-based /bin/echo) SYNOPSIS
xmessage [ -buttons label1[:value1],label2[:value2], ... ] [ options ] -file filename xmessage [ -buttons label1[:value1],label2[:value2], ... ] [ options ] message ... DESCRIPTION
The xmessage program displays a window containing a message from the command line, a file, or standard input. Along the lower edge of the message is row of buttons; clicking the left mouse button on any of these buttons will cause xmessage to exit. Which button was pressed is returned in the exit status and, optionally, by writing the label of the button to standard output. The program is typically used by shell scripts to display information to the user or to ask the user to make a choice. Unless a size is specified, xmessage sizes itself to fit the message, up to a maximum size. If the message is too big for the window, xmessage will display scroll bars. OPTIONS
These are the command line options that xmessage understands, in addition to the standard ones listed in X(7). -buttons button,button,... This option will cause xmessage to create one button for each comma-separated button argument. The corresponding resource is but- tons. Each button consists of a label optionally followed by a colon and an exit value. The label is the name of the Command but- ton widget created and will be the default text displayed to the user. Since this is the name of the widget it may be used to change any of the resources associated with that button. The exit value will be returned by xmessage if that button is selected. The default exit value is 100 plus the button number. Buttons are numbered from the left starting with one. The default string if no -buttons option is given is okay:0. -default label Defines the button with a matching label to be the default. If not specified there is no default. The corresponding resource is defaultButton. Pressing Return anywhere in the xmessage window will activate the default button. The default button has a wider border than the others. -file filename File to display. The corresponding resource is file. A filename of `-' reads from standard input. If this option is not sup- plied, xmessage will display all non-option arguments in the style of echo. Either -file or a message on the command line should be provided, but not both. -print This will cause the program to write the label of the button pressed to standard output. Equivalent to setting the printValue resource to TRUE. This is one way to get feedback as to which button was pressed. -center Pop up the window at the center of the screen. Equivalent to setting the center resource to TRUE. -nearmouse Pop up the window near the mouse cursor. Equivalent to setting the nearMouse resource to TRUE. -timeout secs Exit with status 0 after secs seconds if the user has not clicked on a button yet. The corresponding resource is timeout. WIDGET HIERARCHY
Knowing the name and position in the hierarchy of each widget is useful when specifying resources for them. In the following chart, the class and name of each widget is given. Xmessage (xmessage) Form form Text message Command (label1) Command (label2) . . . RESOURCES
The program has a few top-level application resources that allow customizations that are specific to xmessage. file A String specifying the file to display. buttons A String specifying the buttons to display. See the -buttons command-line option. defaultButton A String specifying a default button by label. printValue A Boolean value specifying whether the label of the button pressed to exit the program is written to standard output. The default is FALSE. center A Boolean value specifying whether to pop up the window at the center of the screen. The default is FALSE. nearMouse A Boolean value specifying whether to pop up the window near the mouse cursor. The default is FALSE. timeout The number of seconds after which to exit with status 0. The default is 0, which means never time out. maxHeight (class Maximum) The maximum height of the text part of the window in pixels, used if no size was specified in the geometry. The default is 0, which means use 70% of the height of the screen. maxWidth (class Maximum) The maximum width of the text part of the window in pixels, used if no size was specified in the geometry. The default is 0, which means use 70% of the width of the screen. ACTIONS
exit(value) exit immediately with an exit status of value (default 0). This action can be used with translations to provide alternate ways of exiting xmessage. default-exit() exit immediately with the exit status specified by the default button. If there is no default button, this action has no effect. EXIT STATUS
If it detects an error, xmessage returns 1, so this value should not be used with a button. SEE ALSO
X(7), echo(1), cat(1) AUTHORS
Chris Peterson, MIT Project Athena Stephen Gildea, X Consortium X Version 11 xmessage 1.0.4 XMESSAGE(1)
All times are GMT -4. The time now is 02:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy