gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] Problems restoring database on Mac - unsupported 'edi


From: Sebastian Hilbert
Subject: Re: [Gnumed-devel] Problems restoring database on Mac - unsupported 'editor' command
Date: Wed, 06 Nov 2013 10:17:30 +0100
User-agent: KMail/4.11.2 (Linux/3.11.0-13-generic; KDE/4.11.2; i686; ; )

Hi,

Am Mittwoch, 6. November 2013, 08:57:11 schrieb Busser, Jim:
> It appears that the 'editor' command employed on line 121 of
> gm-restore_database.sh :
> 
> editor ${BACKUP}-roles.sql
> 
> is not universal across POSIX systems … while I found these references,
> 
>  http://stackoverflow.com/a/6762336 and
>  http://unix.stackexchange.com/a/77091
> 
> it is in any event not included in Mac OS nor is $EDITOR among the
> environment variables. As a result, running
> 
> gm-restore_database.sh
> 
> on Mac fails at line 121 with
> 
> line 121: editor: command not found.
> 
> Options:
> 
> 1) insert, into the gm-restore_database.sh script, either
> 
> (above the 'editor' line)
> alias editor='open -a TextEdit'
> 
> or a test like
> 
> if Mac
> open -a TextEdit ${BACKUP}-roles.sql
> else
> editor ${BACKUP}-roles.sql
> 
> or
> 
> 2) rely on a Mac maintainer to supply a Mac server package which does the
> above. -- Jim


Thanks for reporting.

/usr/bin/editor is a symlink to /etc/alternatives/edior which in turn is a 
symlink to /bin/nano at least on my system

While the correct solution is debatable you should get around by setting the 
symlinks and letting it point to 'open'. I guess I would create a small shell 
script in /usr/bin

e.g. /usr/bin/editor.sh

--------------
open -a TextEdit $1
-------------

Then you don't need any symlinks because bootstrap will call the shell script 
which in turn will call TextEdit.

Sebastian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]