bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug with script


From: Aharon Robbins
Subject: Re: bug with script
Date: Sun, 5 Aug 2001 00:37:09 +0300

Greetings.

> From: "Lisa" <address@hidden>
> To: <address@hidden>
> Cc: <address@hidden>
> Subject: bug with script
> Date: Sat, 28 Jul 2001 08:29:22 -0400
> 
> I was trying to do this but it keeps on repeorting that there is a bug.
> 
> #!/usr/bin/ksh
> 
>  long="$1"
>  volume="$2"
>  temperature="$3"
> 
>  while [ "$#" !D "3" ]
>  do
> 
>      echo "Please provide three arguments"
>      echo 'The format should be length(cm/in) volume(ga/li)
>  temperature(C/F)'
>      echo "Note: Insert a space between each set of value."
>      read inputentered
> 
>      echo "$inputentered" | awk
>      '{if (NF != 3)
>              print NF;
>          {
>              continue;
>          }

here is one problem; the print should be inside the braces.

>          else
>          {
>              long="$1";
>              volume="$2";
>              temperature="$3";
>              break;
>          }

Here, you should not have quotes around the field names; awk is
not shell or perl.

        long = $1

and so on.

>      }'
> 
>  done

You might wish to read up a bit on awk programming. I recommend
http://www.oreilly.com/catalog/awkprog3, but I'm biased.

Good luck,

Arnold



reply via email to

[Prev in Thread] Current Thread [Next in Thread]