Jza Posted September 29, 2006 Report Share Posted September 29, 2006 Hi I would like to know how to use sed and cron. I know this are both very basic tools but maybe because they are I havent been able to find a coherent tutorial that works with this. i am looking to do the following: - Sed; - search and replace - insert a break line every number of characters - cron - set a cronjob Quote Link to comment Share on other sites More sharing options...
scoonma Posted September 29, 2006 Report Share Posted September 29, 2006 Hi jza, with sed you could to the following to search&replace: sed -e 's/oldpattern/newpattern/g' file > newfile This would replace all strings matching oldpattern with the string in newpattern in "file", writing the output to "newfile". Patterns follow the rules of perl regular expressions. You can find an introduction to regex here: http://www.anaesthetist.com/mnm/perl/regex.htm For cron, check "man cron", "man crontab" and study the cron related files in /etc. A good explanation of the structure of a crontab file is here: http://en.wikipedia.org/wiki/Crontab If you'd like to have some job done regularly, you can edit one of those files in /etc accordingly. HTH, scoonma Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.