Run crontab with user input Run crontab with user input shell shell

Run crontab with user input


If the input is read by the script from stdin, just redirect input from a file (using a wrapper script).

#! /bin/shtest.sh < data.in

If this does not work for you (i.e. you have your script calling some interactive shell program like telnet, you can use Expect to automate the interaction.


  1. file1.sh gets user input and writes it to /etc/file2.dat
  2. file2.sh reads /etc/file2.dat and does whatever it needs


This seems like a strange thing to do. Ask yourself these questions:

Do you really want a popup asking the user for an input value every time the cron runs?

What happens when there's no one at the keyboard?