[TxMt] Re: running command to remote computer via ssh

Charles Stuart cs at enure.net
Wed Aug 16 20:59:26 UTC 2006


Thanks everyone. Here is the bundle command and remote script:
Everything except the first two directories in $TM_FILEPATH are good,
so we just cut out those (/Volumes/localhost).

_TM Bundle Command:

ssh remote_machine_address "bin/ctco_from_remote.sh $TM_FILEPATH"

_Script on Remote Machine:

#!/bin/sh

FILE="$1"
FILE=${FILE#/Volumes/localhost}

#echo "$FILE" > ~/bin/ctco_from_remote.filename

ct checkout $FILE




On 8/16/06, Allan Odgaard <throw-away-1 at macromates.com> wrote:
> On 16/8/2006, at 22:24, Charles Stuart wrote:
>
> > Next question: Is there a TM variable for the current open file? So,
> > just like TM_FILEPATH, but with just the file name?
>
> There is TM_FILENAME.
>
> > [...] I'm not sure how one would go about removing part of the
> > TM_FILEPATH.
>
> Should a similar situation arise:
>
> Using a shell command to do it:
>
>     "$(basename "$TM_FILEPATH")"
>
> Using bash variable substitution:
>
>     "${TM_FILEPATH##*/}"
>
>



More information about the textmate mailing list