Skip to main content
added 99 characters in body
Source Link
Stéphane Chazelas
  • 584.8k
  • 96
  • 1.1k
  • 1.7k

$? is the exit status of the last command that was run. In your case, that's of the [ command (which you use to test whether the true string is non-empty as a condition of your while loop).

You almost never need to use $? explicitly. Just do

la=500
while
  mark=$(zenity --scale \
      --text 'FREQUENCY' \
      --value="$la" \
      --min-value=0 \
      --max-value=5000 \
      --step=1)
do
  echo "$mark"
  la=$mark
done

Or simply:

mark=500
while
  mark=$(zenity --scale \
      --text 'FREQUENCY' \
      --value="$mark" \
      --min-value=0 \
      --max-value=5000 \
      --step=1)
do
  echo "$mark"
done

$? is the exit status of the last command that was run. In your case, that's of the [ command.

You almost never need to use $? explicitly. Just do

la=500
while
  mark=$(zenity --scale \
      --text 'FREQUENCY' \
      --value="$la" \
      --min-value=0 \
      --max-value=5000 \
      --step=1)
do
  echo "$mark"
  la=$mark
done

Or simply:

mark=500
while
  mark=$(zenity --scale \
      --text 'FREQUENCY' \
      --value="$mark" \
      --min-value=0 \
      --max-value=5000 \
      --step=1)
do
  echo "$mark"
done

$? is the exit status of the last command that was run. In your case, that's of the [ command (which you use to test whether the true string is non-empty as a condition of your while loop).

You almost never need to use $? explicitly. Just do

la=500
while
  mark=$(zenity --scale \
      --text 'FREQUENCY' \
      --value="$la" \
      --min-value=0 \
      --max-value=5000 \
      --step=1)
do
  echo "$mark"
  la=$mark
done

Or simply:

mark=500
while
  mark=$(zenity --scale \
      --text 'FREQUENCY' \
      --value="$mark" \
      --min-value=0 \
      --max-value=5000 \
      --step=1)
do
  echo "$mark"
done
Source Link
Stéphane Chazelas
  • 584.8k
  • 96
  • 1.1k
  • 1.7k

$? is the exit status of the last command that was run. In your case, that's of the [ command.

You almost never need to use $? explicitly. Just do

la=500
while
  mark=$(zenity --scale \
      --text 'FREQUENCY' \
      --value="$la" \
      --min-value=0 \
      --max-value=5000 \
      --step=1)
do
  echo "$mark"
  la=$mark
done

Or simply:

mark=500
while
  mark=$(zenity --scale \
      --text 'FREQUENCY' \
      --value="$mark" \
      --min-value=0 \
      --max-value=5000 \
      --step=1)
do
  echo "$mark"
done