Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> Writing a Script with requirements
bubbawoo
post Jul 23 2017, 05:09 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 23-July 17
Member No.: 19,832



I am VERY new to Linux and am trying to do this extra credit for a class. I have tried researching and there is so much information, I am just not sure how to make this work. This is what I have been tasked to do:

You will need to write a script named "getQuote.sh" (must be executable) that meets the following requirements:

1. Check if the file "quote1" exists in your home directory.
2. If the file "quote1" does not exist in your home directory, copy it from "/some/crazy/file" to your home directory.
3. Print the contents of the file "~/quote1" to the screen.
4. Compress the file "~/quote1" using the gzip utility AFTER requirement 3.

I have tried entering the following lines for the script, but it doesn't work:

#!/bin/bash

if [ -f ~/.quote1 ]; then
cp ~/.quote1 ~/.quote1.old
ls -alh ~/.quote*
gzip ~/quote1
fi

Please help!!!
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd November 2017 - 12:25 AM