SUMMARY: script unable to get arguments

From: Gérard Henry (ghenry@cmi.univ-mrs.fr)
Date: Thu Dec 22 2005 - 15:04:14 EST


thanks to
Anthony Florendo
Andrew Hall
Brad Morrison

i forgot to say that this script was called by thunderbird when there is
an attachement.
I made a hack with sed, and create a new file without spaces:

fich=`echo "${@}"| sed -e s/\ /_/g`
cp "${@}" $fich
/opt/sfw/bin/enter_lxrun_env -R /usr/local/linux -P
/opt/sfw/etc/lxrun_pathmap
/usr/local/linux/usr/local/Acrobat5/bin/acroread $fich 2> /dev/null
rm $fich

Girard Henry wrote:
> hello all,
> on solaris sparc, i had a script to wrap acroread:
>
> serv1-henry% cat /bin/acroread
> #!/bin/sh
> # don't leave any core files around
> ulimit -c 0
> # ligne ajoutie pour suicide aprhs une heure en cas de vrille
> ulimit -t 3600
> LD_LIBRARY_PATH=; export LD_LIBRARY_PATH
> /usr/local/Acrobat-5.0.10/bin/acroread "${@}"
>
> This script works with files whose names contains spaces.
>
> On solaris x86, i'm using a script like this:
> #!/bin/sh
> # don't leave any core files around
> ulimit -c 0
> # ligne ajoutie pour suicide aprhs une heure en cas de vrille
> ulimit -t 3600
> /opt/sfw/bin/enter_lxrun_env -R /usr/local/linux -P
> /opt/sfw/etc/lxrun_pathmap
> /usr/local/linux/usr/local/Acrobat5/bin/acroread "${@}" 2> /dev/null
>
> but now, if a name of a file contains spaces, acroread can't open the
> right file.
> I got something like:
> serv1-henry% pargs 13691
> 13691: /bin/sh /bin/acroread /home/henry/poly an edp.pdf
> argv[0]: /bin/sh
> argv[1]: /bin/acroread
> argv[2]: /home/henry/poly an edp.pdf
> serv1-henry% pargs 13692
> 13692: /opt/sfw/bin/lxrun -0
> /usr/local/Acrobat5/Reader/intellinux/bin/acroread /usr/l
> argv[0]: /opt/sfw/bin/lxrun
> argv[1]: -0
> argv[2]: /usr/local/Acrobat5/Reader/intellinux/bin/acroread
> argv[3]: /usr/local/Acrobat5/Reader/intellinux/bin/acroread
> argv[4]: /home/henry/poly
> argv[5]: an
> argv[6]: edp.pdf
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:38:05 EDT