New Person Added to the Forum


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting New Person Added to the Forum
Prev   Next
# 1  
Old 04-13-2006
New Person Added to the Forum

Hello,

I'm brand new to this forum. I am working on my first Bash shell script. We were given an exercise to get ready for the real assignment. I could use some help.

The exercise is to "set two variables (i. e., file1 & file2) on the command line to the paths of the text files. We are to create a shell script that does the following:
"if either variable does not have a value, output a message and stop. file1=${file1:?must set file1} & file2=:?must set file2} is what I've composed so far.

The output : "There are ___________ lines total in the files. ________has __________% (files) as many __________. "

#I did this part. I typed in lines of text into both files. We are to use quota, echo, run tests, and edit/compose the script in the Vi editor.

The process of doing this is a bit confusing to me.
First I set variables.
Second, I create paths w/text.
Third, I export files.
Fourth, run tests.
Fifth name script files in Vi.

What does $SHELL do?

Can someone model this entire process for me so that I can get a handle how to accomplish the basics of using vi and writing a script?

I would be greatful!

Sincerely,

William Carpenter
 
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. What is on Your Mind?

Updated Forum Search Index Min Word Length to 2 Chars and Added Quick Search Bar

Today I changed the forum mysql database to permit 2 letter searches: ft_min_word_len=2 I rebuilt the mysql search indexes as well. Then, I added a "quick search bar" at the top of each page. I have tested this and two letter searches are working; but it's not perfect,... (1 Reply)
Discussion started by: Neo
1 Replies

2. Shell Programming and Scripting

Script executable only for one person at same time

Hi My question: Is there a way to lock a script if its already running for other users? Like if i want to start a script, that is running by another user, there will be a message: Hey, you cant start the script because its running by another user, try it later. my idea was that the... (10 Replies)
Discussion started by: DarkSwiss
10 Replies

3. What is on Your Mind?

Game: Name this person

Simple rules... 1. Guess who it is, the first person to get it posts the next picture, post your guess as a reply to this thread. 2. Wait for the person who posted the picture to confirm that you are correct before posting a new picture. 3. If the person who posted the picture does not answer... (268 Replies)
Discussion started by: reborg
268 Replies

4. Shell Programming and Scripting

Probably easy question for handy person!!!

I have given file with three columns,example: mm234 5 22 mn237 6 45 de987 4 41 I have to check for input values in second and third column and if it is not numeric I have to deleted using grep function. I keep trying. But help from pros might help me. We know that there is only one... (4 Replies)
Discussion started by: ljubayuu
4 Replies

5. Solaris

Another person that needs Internet help

Ok i have a router, which my sparc 5 is connected to. I can acess the router webpage (192.168.0.1). But I cant access the internet. When i use sys-unconfig i enter my ip address fine then i click none for when it asks me for DNS info because I dont have a domain. I was told i can manually change... (10 Replies)
Discussion started by: vikster007
10 Replies
Login or Register to Ask a Question
exit(1)                                                            User Commands                                                           exit(1)

NAME
exit, return, goto - shell built-in functions to enable the execution of the shell to advance beyond its sequence of steps SYNOPSIS
sh exit [n] return [n] csh exit [ ( expr )] goto label ksh *exit [n] *return [n] DESCRIPTION
sh exit will cause the calling shell or shell script to exit with the exit status specified by n. If n is omitted the exit status is that of the last command executed (an EOF will also cause the shell to exit.) return causes a function to exit with the return value specified by n. If n is omitted, the return status is that of the last command exe- cuted. csh exit will cause the calling shell or shell script to exit, either with the value of the status variable or with the value specified by the expression expr. The goto built-in uses a specified label as a search string amongst commands. The shell rewinds its input as much as possible and searches for a line of the form label: possibly preceded by space or tab characters. Execution continues after the indicated line. It is an error to jump to a label that occurs between a while or for built-in command and its corresponding end. ksh exit will cause the calling shell or shell script to exit with the exit status specified by n. The value will be the least significant 8 bits of the specified status. If n is omitted then the exit status is that of the last command executed. When exit occurs when executing a trap, the last command refers to the command that executed before the trap was invoked. An end-of-file will also cause the shell to exit except for a shell which has the ignoreeof option (See set below) turned on. return causes a shell function or '.' script to return to the invoking script with the return status specified by n. The value will be the least significant 8 bits of the specified status. If n is omitted then the return status is that of the last command executed. If return is invoked while not in a function or a '.' script, then it is the same as an exit. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari- able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not performed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
break(1), csh(1), ksh(1), sh(1), attributes(5) SunOS 5.10 15 Apr 1994 exit(1)