Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
The whole scenario must be written inside your script. Take two weeks to complete this; you can email me questions and we can discuss general questions in class too before this is due.
Write a script that will take two command line arguments. The arguments should have integer values between 0 and 5.
We need to verify that the user of your script has entered two arguments: If NO arguments were entered print out a usage error telling the person what to enter and exit with a value of 1. If the user has specified some arguments, but not 2, print out a message telling the user that 2 arguments are required and exit with a value of 2.
If there are two arguments, verify that the two numbers are within the specified range: 0<= number <= 5. If not, print out an appropriate message and exit with a value of 3 (if the first number is out of range) or 4 (if the second is out of range). You do NOT need to check the second number if the first is out of range.
If the numbers are within range, print the sum of the two numbers entered and the remainder of dividing the sum by 3.
Now, if either argument is 0, add 1 to both numbers. Now use a while loop to print out the integer values from -3 to the product of the two numbers entered (or their modified values).
Ask the user to enter a filename. If the username is null, yell at the user and exit with a value of 5. If the filename does not exist, you should create an empty filename with that name. If the filename exists and is a directory, yell at the user and exit
with a value 6.
Now for the next case (hint hint) read in a number. If it is even, print out even, otherwise print odd.
Create 4 empty files named zip11, zip12, zip41, zip13. Now list all file names in your directory that start with the letters zip. Now rename all files in your directory that start with zip1 so that they start with newzip1 ( example ñ zip13456 would become newzip13456). Careful, wildcarding will not work, so do the brute force way.
Do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and searches) and we'll do our best to help. Keep in mind that your instructor might also be an LQ member.
If you have any specific questions concerning your project, we'll be glad to help, but we aren't going to do it for you. Show us what you've done so far, and tell us where you are having trouble, and we'll be happy to give you some pointers.