On Sun, Jun 13, 2021 at 06:10:23PM +0530, Susmita/Rajib wrote: > But I need to run the script file with xautolock.
So, let me see if I understand you. You rambled so much that it's really not clear what you're asking. But if I'm reading this sentence right, you have a shell script that requires a terminal to work, because you prompt the user for input and then read input from the terminal. And now you would like to run this script as a child of xautolock, which I'm guessing is a pure X11 client program, and does not run inside a terminal. Well, that's just a non-starter. Throw the shell script away, and write a new program that doesn't require a terminal to do its work. This could be achieved in shell by using some tool that interacts with the user without a terminal -- say, zenity or something. Or, you could abandon the shell entrely, and write a Tcl/Tk application instead.