From b48a91771393816d04f4c31627e577c186ce8387 Mon Sep 17 00:00:00 2001 From: Daniel Joseph Barnhart Clark Date: Fri, 25 Aug 2006 17:45:05 +0000 Subject: EncapPackages: ep2target shell portability changes. Still doesn't work with solaris sed. git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2112 ce84e21b-d406-0410-9b95-82705330c041 --- encap/src/encap-profiles/ep2target | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'encap/src/encap-profiles') diff --git a/encap/src/encap-profiles/ep2target b/encap/src/encap-profiles/ep2target index 31beb6e79..1fc8dc816 100755 --- a/encap/src/encap-profiles/ep2target +++ b/encap/src/encap-profiles/ep2target @@ -1,24 +1,27 @@ #!/bin/sh +SED="sed" +#SED="/opt/csw/bin/gsed" + chomp() { - printf "$1" | sed s:^\ ::g | sed s:\ $::g + printf "$1" | ${SED} 's:^\ ::g' | ${SED} 's:\ $::g' } cname() { unset CTMP1 CTMP2 - for PART in $(printf "$1" | sed s:-:\ :g); do - if [ ! "`printf $PART | cut -c1 | sed s:[0-9]:0:g`x" = "0x" ]; then + for PART in `printf "$1" | ${SED} 's:-:\ :g'`; do + if [ ! "`printf $PART | cut -c1 | ${SED} 's:[0-9]:0:g'`x" = "0x" ]; then CTMP1="${CTMP1} ${PART}" fi done - CTMP2="`chomp "$CTMP1" | sed s:\ :_:g | sed s:\+:X:g | tr [a-z] [A-Z]`" + CTMP2="`chomp "$CTMP1" | ${SED} 's:\ :_:g' | ${SED} 's:\+:X:g' | tr [a-z] [A-Z]`" printf "\$(%s)%s" "`basename "$CTMP2"`" "$2" } builddeps() { unset DEPSTMP for LINE in `grep "