The sooner the better, if you're an aussie that lives in Victoria, I'll even try to get you a six-pack of VB.
(That's an incentive alright! Hahahahaha)
The problem that I've got is that I've written a Bourne Shell script, complete with case statements, and it seems that UNIX believes that there's a part missing.
The error that I receive (Ungratefully) is:
syntax error: ;; unexpected
Or at least something to the tune of this, as I know that it's dealing with the case statement, the only question is where I may be wrong, any suggestions anyone?
The only reason that I'm putting this up here is because the ;; that is being referred to is supposedly at the end of the file, where no such symbol / expression exists?
I'm beginning to think that the system is hallucinating.....
Any suggestions as to what the problem might be?
Is the system really on LSD? or is it just my s***ty programming?
Are your case statements correct?
They follow the format:
Also, if you have unmatched " or ' marks anywhere in there, it could be messing you up there somewhere...
Can you post parts of the actual case statement and surrounding code?
[On a side note: I noticed that this is very likely a homework assignment based on your email address... I guess it's not as bad as asking someone to write the script for you, but generally it's not cool to post homework questions. I'm willing to help troubleshoot as long as you write the code yourself, though]
The case statement that is out of sorts is actually within another case statement, would that possible have any effect on the outcome, given that there's 4 items to choose from in both?
Another possibility could be that I'm using windows notepad to create the file, porting it to UNIX via FTP to a local server, could that create problems?
I've also noticed that even though I'm sending the same file the file sizes are different, under dos and UNIX. The difference varies, but it's not more than 100 bytes, should that be cause for concern?
As requested, here's an edited selection of the file:
The text at the bottom (The 4) #Quit portion) is the last part of the first case statement.
Note that I'm now also getting another message, claiming that the indicated line (** Code **) has an unexpected `)'
Just wondering if it would be possible to explain that one too...
Thanks
Aussie_Bloke
[I added code tags for readability....Perderabo]
Last edited by Perderabo; 05-30-2002 at 11:36 AM..
Could some one tell me the difference btw Bourne shell and the Kshell? Which is more flexible and reliable in terms of portability and efficiency. When i type the following command ..
$ echo $SHELL
yields me
/bin/sh
Does this tells me that I am in Bourne shell. If yes, how can i get... (6 Replies)
Exercise Five
Write a Bourne shell script which:
• Professionalism: plan for this from the start.
• Has one command line argument.
• If the command line argument is a directory then the script should output the number of
files in the directory.
• If the command line argument is an ordinary... (2 Replies)
Hi All
I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell.
Some operations like calculation don't work :
cat ${file1} | tail -$((${num1}-${num2})) > ${file2}
Is it possible to activate Korn Shell... (3 Replies)
I do not claim to be an expert, but I have done things with scripts that whole teams of folks have said can not be done. Of course they should have said we do not have the intestinal fortitude to git-r-done.
I have been using UNIX actually HPUX since 1992. Unfortunately my old computer died and... (7 Replies)
Hi guys !!
well i'm still new in learning UNIX , and actually i'm still studying it by myself ..
anyway, some people told me the Bourne-again shell is a good version of UNIX to work on , and i tried to download yesterday but i didn't know how to start it ...... the ReadMe file associated with... (3 Replies)
hey,
i have 2 files... orders and products
how do i do calculations on the order using the products ?
say if the products file is:
a123:shirt:10.00
zz123:nice shirt:19.95
and the order file is:
05/08/30 a123 10
zz123 3
Jun-3-1994 a123 2
2005.06.23 a123 2 (1 Reply)
hey,
i have 2 files... orders and products
how do i do calculations on the order using the products ?
say if the products file is:
a123:shirt:10.00
zz123:nice shirt:19.95
and the order file is:
05/08/30 a123 10
zz123 3
Jun-3-1994 a123 2
2005.06.23 a123 2 (1 Reply)
4. Write a program that will allow a user to input as many numbers as the user wants (use 999 as the choice that ends the user input). The program will then respond:
Highest Number: Answer
Lowest Number: Answer
Sum of the numbers: Answer
Average of the numbers: Answer
Can any1 help... (1 Reply)
Hi, I'm having trouble with some UNIX Bourne shell scripting that I am doing for an assignment.
I am trying to sort a comma delimited file into a sort of format that will print out nicely in a telnet terminal window. I'm having a bit of trouble because all I seem to be getting is garble.
... (3 Replies)