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.


Sign Up Now
> Writing a Script with requirements
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 "" (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:


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

Please help!!!
Go to the top of the page
+Quote Post
Start new topic
post Jul 24 2017, 05:29 AM
Post #2

Its GNU/

Group: Support Specialist
Posts: 1,807
Joined: 23-January 03
Member No.: 360

~/.quote1 I do not know if the . in the file name is a typo but in this context it means hidden which I doubt is what you want.

This is your assignment and not ours so we are not going to write it for you. I/we will answer specific questions. These guides should hellp a bit.
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: 20th June 2018 - 02:29 PM