Why crontab is deleted when running on 'crontab' or 'crontab -' command with ctrl+D ?

Solution Verified - Updated -

Issue

  • crontab replaces when running on crontab or crontab - with ctrl+D in stdin mode.
[test@localhost ~]$ crontab -l
* * * * * echo test 
[test@localhost ~]$ crontab
* * * * * /bin/test                      <----- Type rule and ctrl + D
[test@localhost ~]$ crontab -l
* * * * * /bin/test
[test@localhost ~]$ crontab -            <----- Type nothing and ctrl + D
[test@localhost ~]$ crontab -l
[test@localhost ~]$          # // empty

Environment

  • Red Hat Enterprise Linux

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content