Beginner Scripting for school


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Beginner Scripting for school
# 1  
Old 04-30-2015
Beginner Scripting for school

Hello people, I am new to the forum and to scripting and I'm honored to be a part of the Forum Smilie

At the moment I'm learning to do basic scripting for school.
Now I got 2 assignments that I do not understand. The case scripting I have mastered a bit. But now I have an assingment to make with ''set date'' and I hope you guys can help me Smilie

First assignment is to make a script where that knows when it is Morning,afternoon or evening.

It must use $LOGINNAME to determine whether it's
Good morning <loginname>
Good afternoon <loginname>
Good evening < loginname>

So when you for example put in the commandline: ./timeofday
It must say Good Morning Patrick ( if its morning ).
Or Good afternoon Patrick ( if its the afternoon )

I hope you guys understand what I mean, my english isnt very good.

Second assignment is to make a script that when you put in a ''letter'' it says: You have entered the letter M
And when you put in number it says: You have entered the number 7.

I hope you guys can help me with it.

Much Appreciated

Kind Regards

hulsi
# 2  
Old 04-30-2015
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
This User Gave Thanks to Scrutinizer For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Beginner Bash Scripting Question

Hello, I am new to Linux and studying to become a Unix System Admin. I am taking a course in which I was practicing creating a bash script to ping a particular IP address. The script can be found below: #/bin/bash echo "Enter the IP address" read ip if then ping -c 1 $ip if ;... (3 Replies)
Discussion started by: shah9250
3 Replies

2. Shell Programming and Scripting

Beginner - scripting help!

hi all, i am very new to linux and am trying to create a basic script. I would like the script to copy files from one directory into another, (e.g Script ~/my-documents/fileone ~/my-documents/filetwo) Once all files have been copied, i'd like another script to run automatically and rename... (12 Replies)
Discussion started by: highland
12 Replies

3. Homework & Coursework Questions

shell scripting project for school

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: i need to prompt the user for a) group of scores b) calculate the lowest and highest scores and... (1 Reply)
Discussion started by: bodhi 926
1 Replies

4. UNIX for Dummies Questions & Answers

shell scripting project for school

i need to prompt the user for a) group of scores b) calculate the lowest and highest scores and overall average c) print out to the screen d ask if user has any more data to process, if so repeat (loop) for a new set of scores if not exit. i have this much,and trust me i know... (1 Reply)
Discussion started by: bodhi 926
1 Replies

5. OS X (Apple)

scripting beginner

hi i have been given the task of sorting some scripting issues , i first of all need to decifer the ones that are being used is there anybody can do this for me :rolleyes: (4 Replies)
Discussion started by: aguiness
4 Replies

6. Shell Programming and Scripting

[Bash] Beginner at scripting

Hi, I'm a beginner at shell scripting, just started scripting in bash a few days ago. I want to test if the command ls *.jpg returns exit code 2, and if yes I want to execute a new command ls *.jpeg, doing a test on it... and pretty much repeat the procedure. Is this correct? #!/bin/bash... (1 Reply)
Discussion started by: Utherr
1 Replies

7. Shell Programming and Scripting

Need help for scripting beginner

hy guys, I have perl script provided to me but i need to convert it into shell .Can you help me in this using sed shell command. cat /etc/passwd |perl -ne '/^(\w+):\w+: (\w+)/ and print "$1, $2\n";' (1 Reply)
Discussion started by: singh_king
1 Replies

8. Homework & Coursework Questions

Beginner Scripting Issue

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: The object is to enter a number, then have another classmate guess the entered number. 2. Relevant commands,... (6 Replies)
Discussion started by: Jjohn1987
6 Replies

9. Shell Programming and Scripting

Beginner bash scripting - a few problems

Hey Guys, I am creating a bash script on my freeBSD box, the script should basically ask the user to enter a username and domain. The script will take this information and basically append alot of information to config files so the user can receive email from that domain and create a web site at... (1 Reply)
Discussion started by: traxy
1 Replies
Login or Register to Ask a Question