Looking for a very simple Bash script for automate

2019-09-21 15:34发布

问题:

I would like to write a very simple linux bash script that simulates the key-combination "ctrl+S" every 60 seconds and runs in the background.

Unfortunately I don't have any clue about Bash Scripts and couldn't find related topics. Could someone help me out?

Thanks!

回答1:

Use xdotool in a loop:

while sleep 60
do
  xdotool key ctrl+s
done


回答2:

The script is just supposed to regularly save a google docs spreadsheet in the browser.

This is unnecessary. Google Docs spreadsheets save themselves automatically anyway.



标签: linux bash key