Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to run fdisk and automatically do a particular command, like p (print)

installation.sh:

fdisk /dev/sdc1

I don't know how to give the process input to the programm.

share|improve this question

You Can use crontab

crontab -e

crontab tool in linux is used to run script automatically.

you have to write MIN HOUR DOM MON DOW CMD your_script in crontab shell than you script will run automatically.

suppose if min=1 and remaining things are * than your script will run in every 1 min.

For more http://en.wikipedia.org/wiki/Cron

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.