Sponsored Content
Full Discussion: School ending Script
Top Forums UNIX for Beginners Questions & Answers School ending Script Post 302997984 by Cerda on Tuesday 23rd of May 2017 05:24:11 PM
Old 05-23-2017
School ending Script

Hello beautiful people, I would like to kindly ask you to help me with my school leaving project. Unfortunatelly due to family problems I felt into trouble and I am on able to finish my project due to schedule.

I would like to ask you to review this script and give me any hints that you could. I am not usually asking others for help so I am really ashamed to do it right now, but I feel I don't have any more options.

Thank you for understanding.

Here is the script :


The script should offer a menu with the following options:
  • To create a backup copy of a script file.
    • The name of the backup copy should have backup after the name of the script and be date stamped e.g. Ass3Script_backup_10_11_2015.
    • It should be saved to your home directory using the Environment Variable for your home directory.
    • The script should error check that the file exists and is a normal file. If this is not the case then the script should allow the user to re-enter the filename until a valid filename is entered
  • To create a date stamped log file called e.g. log_file_10_11_2015 containing
    • A list of who is logged into the system,
    • The disk usage and
    • Your currently running processes.
    • The file should be saved to an existing directory called log_dir which should be situated off your home directory
  • To create a copy of a file.
    • The file should be in your current directory (the name of the file to be given by the user)
    • The destination directory name to be given by the user.
    • The script should error check that the file exists and is a normal file. If this is not the case then the script should allow the user to re-enter the filename until a valid filename is entered.
    • The script should check that the destination directory exists. If this is not the case then the script should allow the user to re-enter the destination directory until a valid directory is entered.
  • To move the location of a file in your current directory (the name and destination to be given by the user).
    • The script should error check that the file exists and is a normal file. If this is not the case then the script should allow the user to re-enter the filename until a valid filename is entered.
    • The script should check that the destination directory exists. If this is not the case then the script should allow the user to re-enter the destination directory until a valid directory is entered.


This script should loop continuously until the user chooses to quit.



I would really appreciate any kind of help you could give me.


Thank you very much in advance.

Last edited by rbatte1; 05-24-2017 at 08:12 AM.. Reason: Corrected spellings. Removed all FONT and other awkward tags. Set up lists with the LIST tags
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ssh not ending (sometimes) from inside a script, why?

Okay I have this script file that runs from cron and most the time it works just find. Except every so often one of the three ssh commands I have in it just doesn't know it's done and that of course causes the whole thing to hang! The ssh command has executed. I can tell this because the command... (1 Reply)
Discussion started by: stilllooking
1 Replies

2. Shell Programming and Scripting

Ending script after a specified time.

Hi All, I am having a script, which run fine. But what I want to do is that the script should run for specified time and terminate then ( say for a minute). Can somebody help me for this. I would be greatful. Thanks, Aru (8 Replies)
Discussion started by: aarora_98
8 Replies

3. Shell Programming and Scripting

Ending a script

Hi all, I am trying to end a Menu script. Can people suggest various methods please? At the moment I am doing: quit=n while do ...Code Code Code... read userinput case $userinput in q|Q) quit=y;; esac done But this doesn't seem to work every time, occasionally it will work,... (6 Replies)
Discussion started by: mikejreading
6 Replies

4. Shell Programming and Scripting

Ending script at specific time.

Hello Everybody.. I've written the script that kick off through CRON job and kill itself by specific time. I've start time and end time specify in env file. i.e START_TIME=1500 (03:00 PM) END_TIME=0600 (06:00 AM) It always works good if my START_TIME is before midnight and my... (4 Replies)
Discussion started by: nirav_soni
4 Replies

5. Shell Programming and Scripting

sed in script creates output file ending with '?' (^M)

Hi, I'm trying to use sed within a shell script (bash, running ubuntu). The command works fine from the command line, but when I use it within the script, rather than creating a file with the name I've specified, it creates one that ends with a question mark '?' when you use ls, e.g.... (3 Replies)
Discussion started by: jennykay
3 Replies

6. Shell Programming and Scripting

UNIX script abruptly ending due to ssh command

Below UNIX script abruptly ends while reading second line from file. When I comment 'ssh' command the script works as expected. I think I will have to run ssh command in a different process, but haven't got a handle yet as regards to how to do that. Any help in resolving this problem is highly... (1 Reply)
Discussion started by: jeeteshkc
1 Replies

7. Shell Programming and Scripting

Repetitive ending of script

Hi, I am quit satisfied with this scrtipt and really don't want to change anything but the end. I get a repetitve option when I want to "quit" and don't know why. What am I missing? When I press q to quit with this script, I get an EXTRA "Enter " How do I correct this so that when I press... (1 Reply)
Discussion started by: jefferj54
1 Replies

8. Shell Programming and Scripting

Shell script to check line end not ending with comma

I have several line in a text file. for example I like apple; I like apple I like orange; Output: I like apple I try to useif grep -q "!\;$"; then (Not work) Please use CODE tags when displaying sample input, sample output, and code segments (as required by forum rules). (1 Reply)
Discussion started by: cmdcmd
1 Replies
All times are GMT -4. The time now is 02:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy