2

I'm not in front of a testing environment right now but I desire to download a Bash script with curl and then load its content into crontab.

The content as appears in Github raw document is for example:

0 0 * * * ... 
0 0 * * 0 ...

Is this code template looks okay to you?

curl -O https://raw.githubusercontent.com/user/repo/master/file.sh | crontab
1
  • You said curl by default outputs to stdout. I think I understand you: The pipe works on stdin therefor it will fail, right? Jan 12, 2018 at 18:08

1 Answer 1

3

curl outputs to stdout by default so

curl URL

is enough. And at least on macOS crontab needs a - to read from stdin so we end up with

curl URL | crontab -

Whether it is wise to load unverified data from an URL directly into Cron is another question though...

1
  • Thanks, the data is verified from my personal Github account. Jan 12, 2018 at 18:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .