Uix Script Help Need

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2008
Posts: 11
Reputation: deven1974 is an unknown quantity at this point 
Solved Threads: 0
deven1974 deven1974 is offline Offline
Newbie Poster

Uix Script Help Need

 
0
  #1
31 Days Ago
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 11
Reputation: deven1974 is an unknown quantity at this point 
Solved Threads: 0
deven1974 deven1974 is offline Offline
Newbie Poster
 
0
  #2
30 Days Ago
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. }
Originally Posted by deven1974 View 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.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,836
Reputation: ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all 
Solved Threads: 119
ithelp's Avatar
ithelp ithelp is offline Offline
Posting Virtuoso
 
0
  #3
30 Days Ago
What is ur script supposed to do but not doing ?
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC