#!/bin/tcsh -f
#==============================================================
#
#  Abs:  cmdSrv script file to execute a Linux application like dm.
#
#  Name: csp2main
#
#  Rem: This file is executed by the "Command Server" program cmdSrv.
#
#       It is better to use exec below rather than just running a program (eg dm).
#       That's because the client KILL command doesn't work as we would like
#       it if we run the program.  That's because running a program would fork
#       a child to run the program.  Then, we would KILL only the parent of 
#       that child (the one forked from cmdSrv).
#
#       If you do run the program (instead of exec'ing it),
#       NEVER run in background (with & after it).
#       That will mess up the way cmdSrv tests for completion of the
#       child that this script is executing in.  It would cause cmdSrv
#       to think that the child terminated immediately.
#
#  Usage:  send a command to cmdSrv to execute this script
# 
#  Facility: 
#
#  Auth: 07-Aug-2000, Ron MacKenzie (RONM
#  Rev:  dd-mmm-yyyy, Reviewer's Name    (USERNAME)
#
#--------------------------------------------------------------
#  Mod:
#        02-Apr-2007, Ron MacKenzie (ronm)
#               Take out commented out stuff to clean it up.
#        10-Oct-2006, Ron MacKenzie (ronm)
#               Took csp2main and created this generic example
#               for LCLS
#     
#
#==============================================================
#
# Source csEnvs.csh to source ENVS.csh and error check it:
if (-e /afs/slac/g/lcls/tools/cmdSrv/script/csEnvs.csh) then
    source /afs/slac/g/lcls/tools/cmdSrv/script/csEnvs.csh  
else
    source /usr/local/cd/soft/dev/script/csEnvs.csh  # TBD for LCLS
endif
#
#
# Now, run the thing (using exec).
#
# exec dm pepii_main.dl -iconic >& /dev/null
#
exec edm -x -eolc pps_in20_main_standalone.edl >& /dev/null
#
# End of script

