hazcod / maclaunch

Manage your macOS startup items.
MIT License
305 stars 16 forks source link

Ignore comments in crontab files #19

Closed srcshelton closed 2 years ago

srcshelton commented 2 years ago

Where a user has a crontab containing comments, many blank entries are output by maclaunch list as it tries the parse the data in the arbitrary comment line as a valid crontab entry.

As per crontab(5):

Blank lines and leading spaces and tabs are ignored. Lines whose first non-space character is a pound-sign (#) are comments, and are ignored. Note that comments are not allowed on the same line as cron commands, since they will be taken to be part of the command. Similarly, comments are not allowed on the same line as environment variable settings.

… so a filter for lines starting with [[:space:]]# should likely be applied.

hazcod commented 2 years ago

Hi, thank you for creating the GH issue! Can you try this version? https://github.com/hazcod/maclaunch/blob/fix/croncomments/maclaunch.sh