3 Replies - 913 Views - Last Post: 30 November 2009 - 11:41 AM Rate Topic: -----

#1 izthrower  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 233
  • Joined: 11-February 09

Shell Scripting

Posted 30 November 2009 - 10:54 AM

Create a bash shell script called “junk” which is a safe version of Unix rm command. However, instead of removing a file, your version will move a given file to a folder called ~/.junk/ (This will happen when junk is called with no options but only with a filename).



· When junk is called with -–ls option, it will list all the files under ~/.junk/ folder.

· When junk is called as -–rm FILE, it will remove the FILE from ~/.junk/ folder interactively.



Create a folder called ~/bin. Put your script “junk” into this folder. Make sure that ~/bin is a part of your $PATH permanently (Note that, after creating ~/bin, if you logout-login or source your bash login initialization files you should be able to see ~/bin as a part of your $PATH. Otherwise, add ~/bin to your $PATH yourself). Therefore, you will be able to run junk from anywhere under your account.



To get a full grade in this part, make sure that your code does error checking!

This is my question.
i havent started any of the code i was hopeing for some on to help me on this or get me pointed in the right direction.
I dont even understand half the question
Can any one help?
Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Shell Scripting

#2 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5388
  • View blog
  • Posts: 27,385
  • Joined: 10-May 07

Re: Shell Scripting

Posted 30 November 2009 - 10:56 AM

View Postizthrower, on 30 Nov, 2009 - 11:54 AM, said:

I dont even understand half the question
Can any one help?

Yes. Ask your teacher/professor/adviser, as that's why you are in school is to learn. The purpose of the assignment is to learn. We'll be happy to help you, but we're of no help to you if you don't understand what the assignment is asking for.
Was This Post Helpful? 0
  • +
  • -

#3 izthrower  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 233
  • Joined: 11-February 09

Re: Shell Scripting

Posted 30 November 2009 - 11:19 AM

ok so from what my understanding of this question im creating a shell script that is like a folder.
i still dont understand how to write the program
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5388
  • View blog
  • Posts: 27,385
  • Joined: 10-May 07

Re: Shell Scripting

Posted 30 November 2009 - 11:41 AM

View Postizthrower, on 30 Nov, 2009 - 12:19 PM, said:

ok so from what my understanding of this question im creating a shell script that is like a folder.

Every detail for this project has been provided. Just take the instructions & you posted re-write it as a script.

Quote

i still dont understand how to write the program

That's what makes it an assignment. Certainly you've gone over this in your courses, or have a text book. If you truly have been given no information, just simply given the assignment with zero class preparation, then I would suggest changing schools.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1