944,126 Members | Top Members by Rank

Ad:
Nov 3rd, 2009
0

Uix Script Help Need

Expand Post »
Can anybody help me with a unix script project that I have no clue on starting it, and also I 'm not that much familiar with unix scripting. Don't get me wrong have little bit experience with Linux, but when comes to script I'm just a beginner. If any someone can assist me with project that would be great. At the bottom is the description of the project:

PROJECT 3

Create your own shell that will allow you to change file status and copy from one directory to another.


If someone can help with this project.

Thanks
Deven


The menu structure I mentioned can be created with the following template:
Shell Scripting Syntax (Toggle Plain Text)
  1. echo "Please choose a folder or file. If you choose a folder you will move into that folder. Enter nothing to exit."
  2.  
  3. read choice
  4.  
  5. if [ "$choice" != "" ]; then
  6.  
  7. if [ -f $choice ]; then
  8.  
  9. echo "$choice options:"
  10. echo "Type hide to hide file."
  11. echo "Type copypro to copy protect."
  12. echo "Type read to set ready only."
  13. echo "Type copy to copy a file from one directory to another."
  14. echo "Type exit to choose a different file."
  15. read op
  16.  
  17. case "$op" in
  18.  
  19. hide)
  20. # code for hide
  21. copy)
  22. # code for copy
  23. copypro)
  24. # code for copypro
  25. read)
  26. # code for read
  27. exit)
  28. # code for exit
  29. *)
  30. # code for error
  31. esac
  32. else
  33. cd $choice
  34. fi
  35.  
  36. fi


But there are many other possible implementations for reaching the solution.
Also more comments for Project 3:

Yes, file status means permissions enable/disable.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
deven1974 is offline Offline
11 posts
since Nov 2008
Nov 3rd, 2009
0
Re: Uix Script Help Need
Can someone can help with this Unix Script? I'm kind of beginner with Unix Script. If someone can help with this?

THanks
Deven
Shell Scripting Syntax (Toggle Plain Text)
  1. f_print_msg{
  2. echo "Please choose a file or directory. If you choose a directory you will move into that folder. Enter nothing to exit."
  3. read -p "$(pwd) => " choice
  4.  
  5.  
  6. f_print_msg()
  7. while [ "$choice" != ""]
  8. do
  9. ## Enter your code here
  10. echo "$choice options:"
  11. echo "Type hide to hide file."
  12. echo "Type copypro to copy protect."
  13. echo "Type read to set ready only."
  14. echo "Type copy to copy a file from one directory to another."
  15. echo "Type exit to choose a different file."
  16. read op
  17.  
  18. case "$op" in
  19.  
  20. hide)
  21. mv "$choice" ".$choice";;
  22. copy)
  23. cp "$choice" "~/$choice";;
  24. copypro)
  25. chmod 333 "$choice" ;;
  26. read)
  27. chmod 555 "$choice" ;;
  28. exit)
  29. exit
  30. *)
  31. # code for error
  32. esac
  33. else
  34. cd $choice
  35. fi
  36.  
  37. fi
  38.  
  39.  
  40.  
  41. f_print_msg()
  42. done
  43.  
  44. }
Click to Expand / Collapse  Quote originally posted by deven1974 ...
Can anybody help me with a unix script project that I have no clue on starting it, and also I 'm not that much familiar with unix scripting. Don't get me wrong have little bit experience with Linux, but when comes to script I'm just a beginner. If any someone can assist me with project that would be great. At the bottom is the description of the project:

PROJECT 3

Create your own shell that will allow you to change file status and copy from one directory to another.


If someone can help with this project.

Thanks
Deven


The menu structure I mentioned can be created with the following template:
Shell Scripting Syntax (Toggle Plain Text)
  1. echo "Please choose a folder or file. If you choose a folder you will move into that folder. Enter nothing to exit."
  2.  
  3. read choice
  4.  
  5. if [ "$choice" != "" ]; then
  6.  
  7. if [ -f $choice ]; then
  8.  
  9. echo "$choice options:"
  10. echo "Type hide to hide file."
  11. echo "Type copypro to copy protect."
  12. echo "Type read to set ready only."
  13. echo "Type copy to copy a file from one directory to another."
  14. echo "Type exit to choose a different file."
  15. read op
  16.  
  17. case "$op" in
  18.  
  19. hide)
  20. # code for hide
  21. copy)
  22. # code for copy
  23. copypro)
  24. # code for copypro
  25. read)
  26. # code for read
  27. exit)
  28. # code for exit
  29. *)
  30. # code for error
  31. esac
  32. else
  33. cd $choice
  34. fi
  35.  
  36. fi


But there are many other possible implementations for reaching the solution.
Also more comments for Project 3:

Yes, file status means permissions enable/disable.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
deven1974 is offline Offline
11 posts
since Nov 2008
Nov 4th, 2009
0
Re: Uix Script Help Need
What is ur script supposed to do but not doing ?
Reputation Points: 769
Solved Threads: 128
Banned
ithelp is offline Offline
1,910 posts
since May 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Shell Scripting Forum Timeline: I need help with the cut command.
Next Thread in Shell Scripting Forum Timeline: connect to oracle retrieve data and work around the data through shell script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC