- Jun 16, 2000
- 30,213
- 12
- 81
I'm in an Advanced Programming Techniques class. The first half is unix, then java, the perl. Thank god after the midterm tomorrow this Unix sh!t is over. I could have learned to like Unix...I can assure you this professor had turned me off to it forever. I'm paying $1500 to be given assignments and teach myself how to do them on google. If you ask her how to do anything, all she'll say is "use the man page" which is rarely any help to the unix newb. Look at this latest part of an assignment.
2. Write, as a script, a "safe" delete command. Filenames passed as command-line arguments to this script are not deleted, but instead gzipped if not already compressed (use file to check), then moved to a /home/username/trash directory. At invocation, the script checks the "trash" directory for files older than 48 hours and deletes them.
Ok. Nothing exceedingly difficult here. What's the problem? We never learned that the file command even exists, let alone how to use it. When I read the man page, it says of an "extension" option....well, it doesn't tell you how to use that option, if you type "extension" it looks for a filename with that name. We also never learned how to implement unix commands into a script like that. If it were c++, I would redirect the output to a temp file, read that file and store it in a variable, thus getting my input from the command(this is assuming I knew hew to use the command). How does one do that with a script? Hell if I know.
This is ridiculous. i can't wait till we move on to java which I already know so i don't have to put up with this sh!t anymore.
2. Write, as a script, a "safe" delete command. Filenames passed as command-line arguments to this script are not deleted, but instead gzipped if not already compressed (use file to check), then moved to a /home/username/trash directory. At invocation, the script checks the "trash" directory for files older than 48 hours and deletes them.
Ok. Nothing exceedingly difficult here. What's the problem? We never learned that the file command even exists, let alone how to use it. When I read the man page, it says of an "extension" option....well, it doesn't tell you how to use that option, if you type "extension" it looks for a filename with that name. We also never learned how to implement unix commands into a script like that. If it were c++, I would redirect the output to a temp file, read that file and store it in a variable, thus getting my input from the command(this is assuming I knew hew to use the command). How does one do that with a script? Hell if I know.
This is ridiculous. i can't wait till we move on to java which I already know so i don't have to put up with this sh!t anymore.