[ LUGOS ] csh -> bash

ike na email.si ike na email.si
Sre Nov 8 23:10:31 CET 2000


Re,

Imam nekaj /bin/chs skript, ki bi jih rad pognal pod 
lupino bash. Žal jih ta ne prepozna kot skripte, pač 
ker je v prvi vrstici #!/bin/csh. Na shell csh ne 
morem menjati, ker tega shella na gostujočem linuxu ni.
 
Je mogoče bash kako prepričati, da bi pognala skripto? 
Source je:
 
---
#!/bin/csh

set self=$0
if ($self:h == $self) then
  setenv IDSS_HOME $PWD
else if ($self !~ /*) then
  if ($?LD_LIBRARY_PATH) then
    setenv LD_LIBRARY_PATH ${IDSS_HOME}:
$LD_LIBRARY_PATH
  else
    setenv LD_LIBRARY_PATH ${IDSS_HOME}
  endif
  if ("$1" == "-init") then
    $IDSS_HOME/idss $*
    exit
  endif
  set pidfile=$IDSS_HOME/Logs/idss.pid
  if (-e $pidfile) then
    set pid=`cat $pidfile`
    /bin/sh -c "kill -0 $pid 2> /dev/null"
    if ($status == 0) then
      echo IDS Server \(PID $pid\) is already running.
      exit
    endif
    rm $pidfile
  endif
  if ("$1" == "-con") then
    $IDSS_HOME/idss $*
  else
    echo IDSS_HOME=$IDSS_HOME
    $IDSS_HOME/idss $*
    sleep 1s
    if (!(-e $pidfile)) then
      sleep 2s
      if (!(-e $pidfile)) then
        echo Server failed to start.
        exit
      endif
    endif
    set pid=`cat $pidfile`
    echo IDS Server \(PID $pid\) is started.
  endif
---END SOURCE---
 
Menjal sem shell v prvi vrstici na /bin/bash, vendar 
skripka takrat ni bila več regularna (žal):
 
$ ./runserver
runserver: line 63: syntax error: 
unexpected end of file 
 
Ima kdo kako idejo?
 
tnx in lp,
-Igor

-------------------
http://www.email.si




Dodatne informacije o seznamu Starilist