Hello Everyone - Student in Need of Help


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Hello Everyone - Student in Need of Help
# 1  
Old 04-07-2007
Hello Everyone - Student in Need of Help

Hi everyone.

Let me just start off by saying I'm a college student and I love playing around with UNIX.

I registered here because I have a UNIX shell scripting class and I am having some issues with my homework. I'm not looking for answers to the problems, just some help to get me on my way.

Here is an example of one of the problems I'm having an issue with.

Quote:
Write a shell script called suffix that will do the following:

1. Insert a reference to the Bourne shell as the command interpreter of this shell script.
2. Add the appropriate comments
3. Test that exactly two command line argruments are enter from the command line. If not, display the usage message and stop the script and set the status to 1. If exactly two are entered, continue processing.
4. The first argument is the name of an existing file. The second agrument is a suffix to be added to the file when you rename it.
5. Rename the first file to the second file name with the suffix append on.
6. Cut and paste you program in the space provided along with a session of the samples being executed.

For example,

$ suffix memo1 .sv

should rename the file called memo1 to a file called memo1.sv

========

$ suffix memo1

Usage: suffix filename suffixname

========

$ suffix memo1 memo2 .sv

Usage: suffix filename suffixname
My main issue is that I don't know the syntax to cut and paste and redirect the output in such a way that it renames the file and everything.

If you guys can help me with the commands I'll need to make this script, I would greatly appreciate it.
# 2  
Old 04-08-2007
I don't think you've quite understood the question. You don't have to cut and paste anything for your code to work. Nor do you have to redirect any output. What is required here is handling command line arguments that are passed to your script. Read the man page of sh in detail, especially the execution section.

Also, since this is homework and against the site rules, I am closing this thread.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Student needs grep command help

I am a Student in college struggling with Linux homework This home work was created by my professor not out of the class text book and is frustrating me and the text book is a little frustrating as well need help with 2 5 6 stuck on 2 currently so I know 5 and 6 will be even more... (9 Replies)
Discussion started by: jetoutant
9 Replies

2. UNIX for Beginners Questions & Answers

Student needs grep command assistance

I am a student in a UNIX/Linux classes having hard time with grep looking for assistance on some home work I need to figure out some kind of grep command to get a out put that only gives me information from a sample file and only list the people with the first name John the sample file is named... (1 Reply)
Discussion started by: jetoutant
1 Replies

3. Shell Programming and Scripting

Student system BASH script

Hi guys, i'm beginner with Unix, I tried my best, but I Really don't know how to finish it :D. here's my problem : I have to do something like Student system - student's name | subjects | mark |credits. after starting script it will ask you for Student's name, then which subject, then the... (2 Replies)
Discussion started by: PrincMehi
2 Replies

4. What is on Your Mind?

Anthropology Student Looking for Research Participants

I am an undergraduate in Anthropology, currently writing my final year dissertation. The subject I have chosen in the Open Source project. I will be writing a detailed ethnography of hacker culture and am searching for research participants. Particularly, I am looking for Open Source user groups... (5 Replies)
Discussion started by: osanthropologis
5 Replies

5. UNIX for Dummies Questions & Answers

student need help!

yes im a student at Sandersville Technical College in Sandersville, Georgia. Im doing a presentation on UNIX can someone help me discribe what UNIX is and how to use it and the different features it has? (6 Replies)
Discussion started by: willnadaze
6 Replies

6. Shell Programming and Scripting

Newbie Student Need Help!

Is there anyone here that can help me with my unix assignment? I've been working on it for 3 days now. It is regarding writing a script. I've got a few questions that I need some answers. Please someone who are willing to help add me to their msn messenger: **************** In one part of... (0 Replies)
Discussion started by: DaSFLiP
0 Replies

7. Linux

Student needs help...

I know taking the easy way out isn't going to help me learn anything, but hopefully it will at least give me some guidence... I have a project and here's what I have to do... A company is currently running a Digital VAX and I have to replace it with a Linux server. There are 19 terminals... (4 Replies)
Discussion started by: MGold4357
4 Replies

8. Programming

novice student needs help

Help! I am very stuck!!! I have to produce a practical implementation of ONC RPC for an assignment and I do not know where to start. I hve done much searching on sun's site but everything is too complicated for someone with my limited knowledge. I only know the very basic unix commands and have... (1 Reply)
Discussion started by: karen79
1 Replies
Login or Register to Ask a Question