IMO:
Comment: aagh! don't do that. No sed. No awk.
Use the crontab command only. Some people have used vi, but editor settings have the potential to render your whole crontab into garbage.
You can do what you want, of course, but if you keep on doing what you seem to be doing, keep lots of backups. And remember, if this is the root crontab you can break lots of other things accidentally.
IMO:
Comment: aagh! don't do that. No sed. No awk.
Use the crontab command only. Some people have used vi, but editor settings have the potential to render your whole crontab into garbage.
You can do what you want, of course, but if you keep on doing what you seem to be doing, keep lots of backups. And remember, if this is the root crontab you can break lots of other things accidentally.
Quote thanks for the tip. Not sure why you see this as a problem, can
you elaborate a bit more?
My issue is I want to automate a process through a script and I want
the cron disabled while the script is running. Would this be a better solution?
crontab -l > filename # save cron file
crontab -r # remove cron file
do work
....
....
crontab <file name> # re-instantiate cron
You save a cron file, lets call it cronfile
you do the changes to the file...
you load the new file:
Dont forget to be the correct user for the correct cron file you wish to modify/load
Dear Gurus,
I have a file which comes every day with set of data, as a part of processing i want to add a comment at the start of every line.
e.g of file
<PCL>
2E;"HCA";"COP Car A";"ODBS_CFG"
7C;"DD";"Doors Car D";"ODBS_CFG"
3D;"XA";"Auxiliary Car A";"ODBS_CFG"
3E;"XB";"Auxiliary... (12 Replies)
I am trying to comment out the crontab entries using sed.
I want to comment it out for a particular environment say '/mypath/scripts/'.
Using the full path as pattern, it is working. but using variable it is not working. i have tried double quotes too. but no luck!
$ crontab -l
... (3 Replies)
I have tried a lot, Need your help guys.
SAS Program:
data one ; /* Data step */
Input name $; /*Dec variables*/
I want to remove the commented part(/* Data step */) alone. I have tried using sed command but it is deleting the entire line itself. i need unix command to separate this and... (6 Replies)
My first comment on every file contains the license message. I want to replace with a new license message. I used the below sed script, which replaces all comments. What is the modification or any other method with awk script for the below to edit only the first comment(license message)?
#sed -f... (1 Reply)
I have around 25 hosts and each hosts has 4 instance of jboss and 4 different ip attached to it . I need to make some changes to the startup scripts. Any tips appreciated. I have total of 100 instances which bind to 100 different ip address based on instance name.
For example
File1
... (1 Reply)
Again a comment removal requirement from me, refer my previous problem & solution for removing comment from ruby scripts: https://www.unix.com/shell-programming-scripting/118296-best-way-removing-comment-ruby-program.html
This time, it is for stripping of comments from Shell Script. I search for... (2 Replies)
Hi all,
I would want to remove all comments from my ruby/rails program. It may seem like a simple task, but it is not so. Because you need to have your tool implemented as like your language parser which is actually not so easy.
And am in the search of it, to remove comment from ruby/rails.... (4 Replies)
I am running a script remotely to do the following
1. Kill all processes by a user
2. Uninstall certain packages
3. FTP over a new file
4. Kill a ldap process that is not allowing my /devdsk/c0t0d0s7 slice to un-mount
5. Unmount /h
6. comment out the slice in vfstab
7. newfs the... (9 Replies)
I'm trying to write a script to help automate some VERY tedious manual tasks.
I have groups of fairly large XML files (~3mb+) that I need to edit.
I need to look through the files and parse the XML looking for a certain flag contained in a field. If I find this flag (an integer value) I need... (4 Replies)
Hi,
I would like to get rid of all comment in an xml file by grep or sed command:
The content seem like this:
<!-- ab cd
ef gh
ij kl -->
Anyone can help?
Thanks and Regards (3 Replies)