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.
It isn't xmessage nor bash that is taking so long, it is vcgencmd. With the path that you are using to invoke that command, we have to assume that this command is not a standard part your operating system and has been installed from a third party vendor or written by someone at your company.
Do you have a manual page for this utility? If so, does it saying anything about options or configuration parameters to shorten the time allowed for a device to respond to a probe?
Have you tried the commands:
and:
to see if there are any built-in help messages that might tell you?
If there is an option or configuration value that can be used to shorten the timeout that program uses before deciding that no camera is connected to your system, note that you may get false negatives if you shorten the time too much. Some devices take a while to warm up and be able to respond when they are probed. And, if the camera you're probing is a device that is accessed through a network (i.e., not directly attached to your computer), network delays can exacerbate any delays imposed by the device itself.
Thanks for your reply.
I started my script by a different method and got a warning message.
This I cured for the moment by adding 'LANG=C' before the call to xmessage.
The message box appears straight away.
I don't know what this change does to the system.
Is there a way of turning off 'LANG=C" or won't it mattter?
Perhaps saving the existing LANG to a variable and then re-instating.
Regards
Last edited by mad-hatter; 08-15-2017 at 06:28 AM..
Reason: spelling
Thanks for your reply.
I started my script by a different method and got a warning message.
This I cured for the moment by adding 'LANG=C' before the call to xmessage.
The message box appears straight away.
I don't know what this change does to the system.
Is there a way of turning off 'LANG=C" or won't it mattter?
Perhaps saving the existing LANG to a variable and then re-instating.
Regards
You could save the setting of LANG before changing it and restore it later (but this is a little more complicated than it sounds), but the way your current script works, your setting of LANG only affects the behavior of your invocations of xmessage and exit (and exit doesn't care).
An easier way to set the value of LANG only for the execution of one command is to combine them like this:
Doing it this way, LANG is set in the environment for that execution of xmessage and does change the setting of lang for any other code in your script.
This User Gave Thanks to Don Cragun For This Post:
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)
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)
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)
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)
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)
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)
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)
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)