csh to sh conversion utility

csh to sh conversion utility

Post by Jerry Natowi » Thu, 22 Jul 1993 20:31:46



Does anyone know of a conversion utility that will allow me to convert
csh scripts into Bourne?

Thanks.
--
     Jerry Natowitz
     Guest user on:

UUCP {ima,harvard,rayssd,linus,m2c}!spdcc!jin

 
 
 

1. Script conversion from csh --> sh

I have just installed xv3.00. The Makefiles invoke './RANLIB.csh'
(seen below) ...

==> RANLIB.csh <==
#!/bin/csh -f
#
# tests to see if the program 'ranlib' exists.  If it does, runs ranlib on
# the first argument (a library name).  Otherwise, does nothing, and returns
#
# written by John Bradley for the XV 3.00 release
# thanks to John Hagan for shell-script hackery
#

echo "executing 'ranlib $1'..."

# Is there a ranlib?  Let's try and then suffer the consequences...
set haveranlib = `ranlib $1 >& /dev/null`

if ( $status ) then
        echo "There doesn't seem to be a ranlib on this system..."
        echo "Don't worry about it."
endif

echo ""
echo ""
==> END: RANLIB.csh <==

Under LINUX i'm only used in using 'bash'. So I try to convert the script
for bash. NOW MY QUESTION: Are the scripts equivalent??

==> RANLIB.sh <==
#    #!/bin/csh -f
#
# tests to see if the program 'ranlib' exists.  If it does, runs ranlib on
# the first argument (a library name).  Otherwise, does nothing, and returns
#
# written by John Bradley for the XV 3.00 release
# thanks to John Hagan for shell-script hackery
#

echo "executing 'ranlib $1'..."

# Is there a ranlib?  Let's try and then suffer the consequences...
haveranlib=`ranlib $1 > /dev/null 2>&1`
STATUS=$?

# echo haveranlib = XXX${haveranlib}XXX
# echo STATUS = $STATUS

if test $STATUS -ne 0 ; then
        echo "There doesn't seem to be a ranlib on this system..."
        echo "Don't worry about it."
fi

echo ""
echo ""
==> END: RANLIB.sh <==

Thanx
Thomas
--
Thomas Grunenberg, Kirchhofallee 12, 2300 Kiel 1, (24103 Kiel)

2. another find/grep question

3. set conversion sh > csh

4. Graphical Mode Hangs; Command Mode Fine

5. sh -> csh conversion problem

6. Interviews

7. Conversion/Utility Unix .sh -> mac?

8. Kernel 1.1.60 breaks resolver

9. VMS DCL to Unix SH conversion utility

10. Execute a sh script under perl and sh: sh script; perl script?

11. conversion of csh scripts to bash

12. ksh -> sh conversion???

13. Automated Conversion from KSH to CSH and vice versa