shell script inside case statement not stdio "read" operation work? can any one know this question solution

Viewed 29

In this shell script not run case inside read operation please check and tell me why?

#!/bin/bash
/usr/bin/dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'" |
  while read x; do
  echo "$x 1111111111111111111111"
    case "$x" in
    "boolean true") echo "only yes please" ;;
    "boolean false")
#is this not line not execute when x == "boolean false and not read line why?
        read -r -p 'Continue? yes/no: ' input;
# read input; it is also tried me
          echo "$input this is =============="
          case $input in
          [yY]*)
            echo "yes please"
            exit 1
            ;;
          [nN]*)
            echo "no please"
            ;;
          *)
            echo "<<<<<<<<<<<<------------" ;;
          esac
    esac
  done

and also suggest me how to forcefully stop shell when we read stdio operation perform. In this case when you run this code and lock ubuntu and again open it you showing a prompt but not read because while loop again execute.

0 Answers
Related