LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Scheduled Interactive shell script possible? (https://www.linuxquestions.org/questions/linux-newbie-8/scheduled-interactive-shell-script-possible-4175523799/)

PH_Linux 10-30-2014 10:15 AM

Scheduled Interactive shell script possible?
 
Is it possible to provide user input (via terminal input) for a shell script that has been scheduled?
A script that looks something like below scheduled via "at" or a cronjob:

#!/bin/bash
echo "Enter something"
read str
echo "String is $str"

wpeckham 10-30-2014 02:05 PM

Possible
 
Research the program 'expect' and consider allocation a virtual terminal for the run.
Better to re-engineer the applciation so it has an 'unattended' mode, but such automation IS possible.


All times are GMT -5. The time now is 05:12 AM.