bug-bash
[Top][All Lists]
Advanced

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

parse error in CASE .. ESAC


From: stig
Subject: parse error in CASE .. ESAC
Date: 9 Jan 2002 23:46:06 -0000

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' 
-DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H  -D_GNU_SOURCE 
-D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/include -O2 
-march=i386 -mcpu=i686
uname output: Linux hackvan.com 2.4.9-12 #1 Tue Oct 30 18:33:49 EST 2001 i686 
unknown
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.04
Patch Level: 21
Release Status: release

Description:
        [Detailed description of the problem, suggestion, or complaint.]

Repeat-By:
        [Describe the sequence of events that causes the problem
        to occur.]


ipcomp() {
  : 'ipcomp <ipaddr> <bits> -- compute netmask, etc for ip address'
  ipaddr=$1
  ipbits=${2-24}
  case "$ipbits" in
    24 ) ipmask=255.255.255.0   ;;
    26 ) ipmask=255.255.255.192 ;;
    27 ) ipmask=255.255.255.224 ;;
    28 ) ipmask=255.255.255.240 ;;
    29 ) ipmask=255.255.255.248 ;;
    32 ) ipmask=255.255.255.255 ;;
    255.* } ipmask=$ipbits ;;
    * ) echo 'please specify netmask as nnn.nnn.nnn.nnn' ; exit 1 ;;
  esac
  ipnet=`ipcalc -n $ipaddr $ipmask | sed 's/.*=//'`
  echo "
;
; $ipaddr -- $ipnet/$ipbits
;
BOOTPROTO=static
BROADCAST=`ipcalc -b $ipaddr $ipmask | sed 's/.*=//`
NETWORK=$ipnet
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=yes
IPADDR=$ipaddr
NETMASK=$ipmask
"
}

YIELDS

-- /etc/sysconfig/network-scripts > ipcomp() {
>   : 'ipcomp <ipaddr> <bits> -- compute netmask, etc for ip address'
>   ipaddr=$1
>   ipbits=${2-24}
>   case "$ipbits" in
>     24 ) ipmask=255.255.255.0   ;;
>     26 ) ipmask=255.255.255.192 ;;
>     27 ) ipmask=255.255.255.224 ;;
>     28 ) ipmask=255.255.255.240 ;;
>     29 ) ipmask=255.255.255.248 ;;
>     32 ) ipmask=255.255.255.255 ;;
>     255.* } ipmask=$ipbits ;;
bash: syntax error near unexpected token `}'



Fix:
        [Description of how to fix the problem.  If you don't know a
        fix for the problem, don't include this section.]



reply via email to

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