The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 03-17-2009
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,365
Quote:
Originally Posted by rambler View Post
Hi all
i want to write a ksh file that can be able to get a path directory and execute an other bach file

A bach file? I use mplayer.
Quote:

my scripte semm like that


Code:
#!/bin/ksh

ENV_ID=$1
WORK_DIR=${PWD%/bin}

#definition de la variable d'environement de la derniere version ECX
SUBDIR=`ls $WORK_DIR/| grep "ecx-batch-1" | tail -1`

Why grep?


Code:
SUBDIR=`ls $WORK_DIR/*ecx-batch-1* | tail -n 1`

Quote:

Code:
SCRIPT_DIR="$WORK_DIR/$SUBDIR"

#echo : that put the right path OK !!!!
echo $SCRIPT_DIR  

. `$SCRIPT_DIR`/bin/target.sh


Code:
. "$SCRIPT_DIR"/bin/target.sh


Last edited by cfajohnson; 03-17-2009 at 07:03 PM..