Platypus - Current Working Directory - write file

Discussion in 'Perl Misc' started by Markus S, Nov 6, 2007.

  1. Markus S

    Markus S Guest

    On 2007-11-06 1:25 pm, Markus S said:

    > On 2007-11-06 5:02, Larry said:
    >
    >> > in Platypus window:

    >>
    >> > Script Type: Shell
    >> > Script Path: your start.sh

    >>
    >> > the followin is the start.sh file:

    >>
    >> > #!/bin/sh
    >> > #
    >> > # start.sh

    >>
    >> > cd $1/Contents/Resources/

    >>
    >> > /usr/bin/perl $1/Contents/Resources/my_perl_script.pl

    >
    > Thanks. Unfortunately, the $1 contains a space in my case and the cd
    > command therefore fails. I would know how to deal with this within Perl
    > but not on the Shell level.


    Hi Larry,

    Well, I've tried to run the whole thing on a path without spaces. There
    it works, but I have to manually place the Perl script in
    Contents/Resources after building the app. I also have tell it to write
    the output file three directory levels higher. All doable but a bit
    cumbersome. Biggest problem however, is that the app does no longer
    seem to be droppable, or at least the 'drops' don't reach the Perl
    script. I guess the Shell script would have to hand them over. Knowing
    very little about about Shell scripts, I am at a loss here.

    I've also tried to use sed to escape the spaces but am more less just
    fumbling around:

    p = "$1/Contents/Resources/";
    q = $(echo $p | sed 's/ /\\ /g')
    cd $q;
    Markus S, Nov 6, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    1
    Views:
    539
    Gordon Beaton
    Aug 12, 2003
  2. Ahmed Moustafa
    Replies:
    1
    Views:
    1,695
  3. Laszlo Nagy

    platypus in page header

    Laszlo Nagy, Jun 2, 2008, in forum: Python
    Replies:
    1
    Views:
    343
    Mike Driscoll
    Jun 2, 2008
  4. Evan Light
    Replies:
    0
    Views:
    255
    Evan Light
    May 7, 2007
  5. Markus S
    Replies:
    6
    Views:
    185
    Tad McClellan
    Nov 7, 2007
Loading...

Share This Page