QwUo173Hy
November 3rd, 2009, 03:29 PM
I've made a script which performs an action based on a string's content. The string is assigned based on the returned value of a command line application.
But on comparison, the script exits if the string contains special characters. My question is, have I gone beyond the scope of bash scripting? Or do I just need to learn more about it. Here's the script:
#! /bin/sh
dropbox start
status=$(dropbox status)
while test $status != 'Idle'
do
echo "Working"
status=$(dropbox status)
done
echo "\nIdle again.. exiting"
dropbox stop
The command 'dropbox status' can return either:
"Idle" or Uploading 1 file (102.8 KB/sec, 1 min left)" and I think it's the latter that is causing the crashing.
But on comparison, the script exits if the string contains special characters. My question is, have I gone beyond the scope of bash scripting? Or do I just need to learn more about it. Here's the script:
#! /bin/sh
dropbox start
status=$(dropbox status)
while test $status != 'Idle'
do
echo "Working"
status=$(dropbox status)
done
echo "\nIdle again.. exiting"
dropbox stop
The command 'dropbox status' can return either:
"Idle" or Uploading 1 file (102.8 KB/sec, 1 min left)" and I think it's the latter that is causing the crashing.