Results 1 to 5 of 5
Hello guys,
Im creatin a bash script for making crontab jobs with ease for a user who dont have a clue.. I dont want the comments o be displayed so ...
- 05-24-2007 #1Just Joined!
- Join Date
- May 2007
- Posts
- 3
Bash script
Hello guys,
Im creatin a bash script for making crontab jobs with ease for a user who dont have a clue.. I dont want the comments o be displayed so i want something like : if the first character of line is"#" then.. etc.. Of course i can print this result with sed and grep but i want to know in my script whats happening so i can do something else if tha "#" character appears... Any ideas how can i implement this??
- 05-24-2007 #2
?
Eh, the script wont print comments if preceded by #
Or do I misunderstand your question?
- 05-25-2007 #3Just Joined!
- Join Date
- May 2007
- Posts
- 3
I know ways so that the comments wont be displayed, but thats not what i want.. I want to know in my script if the line that i am processing is a comment line or another line.. Is there a way to know this?
- 05-25-2007 #4Just Joined!
- Join Date
- May 2007
- Posts
- 3
Ok i solved my problem.. It was so easy though im a newbie shell programmer.. Ok now my problm is that i cant append a single line in the end of the crontab file.. Something like
crontab -l | sed '$a\Text to be appended' | crontab - gives me an error on my mac.. Has anyone any ideas of how this simple work could managed out..
- 05-25-2007 #5
What's the error message? I'm not an amazing sed guy, but the crontab stuff looks right.
DISTRO=Arch
Registered Linux User #388732


Reply With Quote