![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how can i create a simple progress bar in shell | aditya.ece1985 | Shell Programming and Scripting | 5 | 11-30-2007 07:22 AM |
| How to create an run a simple batch file? | Hyunkel | UNIX for Dummies Questions & Answers | 2 | 09-25-2007 09:21 PM |
| Modifying simple commands to create a script | rocinante | Shell Programming and Scripting | 8 | 06-03-2007 10:35 PM |
| TODO: Sync User Tables Between Databases | Neo | Post Here to Contact Site Administrators and Moderators | 0 | 09-20-2000 02:20 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hia all,
I am trying to create a simple script, that will keep me a todo file/log. The idea is to have to scritps, one to enter a new todo file, one to delete (it can be one with different inputs, but this is not the point) e.g. > newEntry Call_home - will add a new line to the log like that: - Call_home [TIME_STAMP] >delEntry Call_home - will update the current task's indicator to + There are many more things I can think off, but this is for starters. My Question is: 1. I have tcsh, where can I learn how to do what I want. (sites with examples are preferable) 2. If you can post a snipplet, that would be great. thanks, Me ![]() |
|
||||
|
re: Cute
![]() Long tim esince I laughed so hard But I can understand, it definitly looks like homework. I am 31 yrs, working as a programmer, only thing, I am a Windows person myslef (don't hate me for that). And csh, tcsh, sed awk, nawk and all these crazy words are still new to me. I still can't tell the diffeence between ll and ls -tr. Anyway, this is NOT homework for me, I am sure someone out there did get this as homework, but last time I got to do homeworks was 5 years ago on my B.Sc. And now to my Q. I did manage to change the '-' to '+' using SED, but it doesn't want to overwrite the file, so I thaught to use a second file to get the change, delete the first one, and rename. I know long, and not very system perfect, but it's work, and this is what I need. (as I said, I don't get points for short programs ^^) I couldn't understand how to add a new line. I read the awk man files, but I am not sure if this is the tool I need. If you can complete this hole for me, that's gr8. Sierra_aar |
|
||||
|
OK, so I've spent some precious tim eI have and got this result.
It works, but I still have a question. The Lockfile script is: #!/usr/local/bin/tcsh -f set fileName = "$1" set DATE = `date '+%Y%m%d-%H%M'` if (`echo $fileName | wc -c` < 3) then echo "Please indicate name of file. > lkf [File Name]" exit endif echo "- $1, $DATE" >> ~/locked_files.log \sort -r ~/locked_files.log and the release file script is: #!/usr/local/bin/tcsh -f set fileName = "$1" if (`echo $fileName | wc -c` < 3) then echo "Please indicate name of file. > frf [File Name]" exit endif \sed 's/- '$fileName'/+ '$fileName'/' ~/locked_files.log > ~/locked_files.log2 \rm ~/locked_files.log \mv ~/locked_files.log2 ~/locked_files.log \sort -r ~/locked_files.log Now, how can I add to the scripts, a message line? if I add a line, it get computed as different inputs, I want evreything after the file name to be treated as one parameter. e.g.: > lkf index.html Fixed image not showing error. will go to the log file as: - index.html, 20020217-1010, Fixed image not showing error. ??? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|