Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Write a shell menu program that will:
a. copy a file to a designated directory
b. tell you if a specified user is logged in.
c. display the details of a specified file
d. list the contents of a specified directory
Check for input errors, issues an error message and continue until the exit option is chosen.
2. Relevant commands, code, scripts, algorithms:
Shell scripting
3. The attempts at a solution (include all code and scripts):
A couple things:
1) Is this a step in the right direction? And could someone please test it just to see if it functions?
2) How would I make the program more portable so that the user can enter the name of a file for option one or enter the name of the person for option 2. What I mean is, how do you make it so you have variables for the options instead of hardcoded ones?
I need to also turn in a printout of the program listing or something too, whatever that means(?)
Thanks.
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Brookdale Community College - Lincroft, New Jersey - United States - Dr. Rick Bournique- COMP 145
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
You printed a prompting message specifying the menu choices available and then read a response from the user letting them select their choice. If the user chose option 1, could you print another prompt asking them to choose the file to be copied and read another response from them to select the file to be copied? If the user chose option 2, could you print another prompt asking them to identify the name of user to search for?
As for you question about what to put in the loop Corona688 mentioned, put everything in the loop that you want to be repeated until the user selects choice 5.
It's progressing, but still has some definite problems.
1) Are you using some kind of non-text editor? Your "double quote" marks come out strange in the code you did such a great job posting. It's a little confusing with those odd "double quote" characters, but there may be problem with not enough or too many of those things.
2) Think about what Don Cragun said before, and it will help explain one reason why it is not currently working:
Quote:
put everything in the loop that you want to be
repeated until the user selects choice 5.
Do you know what a loop is? If not, go back and review the post by Corona688, and move your code around to put "everything you want repeated until choice 5 selected" inside the loop.
hi all
i am trying to get help with writing a script using case statement to display menu as
1) Authentication log
2) System log
3) Messages
4) Dmesg
5) Boot log
Q) Exit
When selecting the menu by 1 or 2 or 3 o 4 or 5, it should display the last 10 lines of the log files,
if... (3 Replies)
Hi All,
I have written a shell script that show menu driven option.
My requirement is that in the menu driven option i want to select multiple choice.
i.e
if i want to select 1 or 1,2 or 1,2,3 or 2,3 etc ....
Can some one help me in that
My script.
while true; do
echo " "
... (8 Replies)
Hi,
I need to have a shell script for the below need.
1. Menu with one heading and 4 options.
2. the heading and 4 options are taken from a file.
File entry
======
Heading1|option1|option2|option3|option4|
Heading2|option1|option2|option3|option4|
3. the user entries must be captured in... (9 Replies)
hi guys, how would you do the following? I have a menu with 5 options in my shell script:
1. Run function 1 against files
2. Run function 2 against files
3. Run function 3 against files
4. Run function 4 against files
5. Run function 5 against files
I'd like to be able to run multiple... (10 Replies)
Hi there, I am new to Unix and at the moment
I am trying to solve my assignment that is to create a script for the program
to prompt user to type three codes,
from user point of view it should be done by
typing codes separating them by spaces.
Then program displays a menu with these three... (5 Replies)
Hi
How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Hi there. I'm trying to teach myself UNIX but the book I bought is a bit confusing. I'm trying out this exercise and I think I'm on the right track, but I'd appreciate any suggestions on how to improve what I have so far. Also, I'm not clear on how to use the read command to utilize the user's... (3 Replies)
when the file is not found i want it to return to the menu, however it carries out the next line when i hit a key
I know its probably something simple can anyone help?
here is my pause function:
function pause(){
read -s -n 1 -p "Press any key to return to Menu . . ."
echo
}
SCRIPT... (2 Replies)
Hi,
I'm writting a script to filter a cvs log and get only the modified files to move them to a specific directory to compile.
I try to filter a line and move from source to target, with no results. Could you help me?
for example, in the cvs log file appears:
cat log.txt
U... (2 Replies)