how to convert from csh to sh

Dear all
I am installing some eda software using script. My OS is ubuntu 10.04 and the eda software writing in csh. Since ubuntu reading script file in sh writting. I need someone can help me to convert some definition in script from csh to sh. Below is part of script

set archinfo = `$installdir/bin/get_arch -r -c -t`
setenv ARCH $archinfo[1]
setenv CMIARCH $archinfo[2]
setenv mraarch ${ARCH}
setenv TMIARCH ${CMIARCH}
unsetenv OMP_NUM_THREADS
unsetenv KMP_BLOCKTIME
unsetenv LANG
unsetenv LC_ALL
limit coredumpsize 0

The sh cell command will post the error when it sees : setenv, unsetenv, limit and [ ]
How I can make a change of thoses? Thanks a lot

Why don't you run it with csh?

/usr/bin/csh <your script>

Or is it that you don't have csh? If so, you can try this...

archinfo=( $( $installdir/bin/get_arch -r -c -t ) )
export ARCH=${archinfo[1]}
export CMIARCH=${archinfo[2]}
export mraarch=${ARCH}
export TMIARCH=${CMIARCH}
export OMP_NUM_THREADS=""
export KMP_BLOCKTIME=""
export LANG=""
export LC_ALL=""
ulimit -c 0

HTH
--ahamed

Hi ahamed
Thanks for your help. I am a newbie to linux and my major in electrical hardware. Changing a new language is realy top for me in short time. If you dont mind could you help me to correct the script below to sh? Thanks

######### HSPICE Global environment variable Sat Dec  3 09:43:05 PST 2011 #########
# Using FLEXlm license file

setenv installdir /home/synopsys/D-2010.03/hspice

set archinfo = `$installdir/bin/get_arch -r -c -t`
setenv ARCH $archinfo[1]
setenv CMIARCH $archinfo[2]
setenv mraarch ${ARCH}
setenv TMIARCH ${CMIARCH}

unsetenv OMP_NUM_THREADS
unsetenv KMP_BLOCKTIME
unsetenv LANG
unsetenv LC_ALL
limit coredumpsize 0

setenv HSP_HOME $installdir
if ( $?PVA_HDL ) then
    if (( $PVA_HDL == 0 ) || ($ARCH == "rs6000")) then
        unsetenv PVA_HDL
    else
        setenv PVA_HDL 1
    endif
else if ($ARCH != "rs6000") then
    setenv PVA_HDL 1
endif

if ( $?UNIFIED_VA) then
    if ( $UNIFIED_VA == 0) then
        unsetenv PVA_HDL
    endif
endif

setenv SNPS_PLATFORM     $ARCH

set XARCH = $ARCH
if ( -f /etc/SuSE-release ) then
    set XARCH = suse64    # must use suse64 gcc compiler for suse32
else
    if ( Xi686 == X"x86_64" ) then
        set XARCH = amd64
    endif
endif

if ( $XARCH == x86sol32 ) then
    set X86SOL = -R/usr/sfw/lib
else
    set X86SOL = ""
endif

if ($ARCH != "rs6000") then
    setenv HSP_GCC  "$HSP_HOME/GNU/$XARCH/gcc-4.2.2-static/bin/gcc $X86SOL"
    setenv HSP_GCC_VERSION   `$HSP_GCC -dumpversion`
endif

if ( $?LM_LICENSE_FILE ) then
    if (( "$LM_LICENSE_FILE" !~  *"/home/synopsys/D-2010.03/hspice/license.dat"* )&& (-e  /home/synopsys/D-2010.03/hspice/license.dat)) then
      setenv LM_LICENSE_FILE /home/synopsys/D-2010.03/hspice/license.dat:$LM_LICENSE_FILE
   endif
else
   if (-e /home/synopsys/D-2010.03/hspice/license.dat) then
      setenv LM_LICENSE_FILE /home/synopsys/D-2010.03/hspice/license.dat
   endif
endif


set path= (  $HSP_HOME/bin $installdir/$ARCH  $path )



######### End of Global section ##########

Your script is tried and tested by the developers of the system you want to install and will work. It is possible for someone here to convert it to sh or bash for you and it work first time, but I would not want to chance it and it is better if you can run the original script. If tcsh does not exist on your system get it with the command:

sudo apt-get install tcsh

Then you will be able to run the code without having to rewrite it.

Andrew