Re: Question: how to run Reconfigure without GUI
I futureproofed it a little :-)-O #!/bin/bash function lyxconfigure { if [[ "$OSTYPE" == "darwin"* ]] then BASEDIR="/Users/$(whoami)/Library/Application Support/LyX" LYXVER=$(lyx --version 2>&1 \ | perl -ne 'if (/^LyX/) { @v = split(/\s+/); ($j,$i) = split(/\./,$v[1],3); print "$j.$i" }' ) pushd "$BASEDIR-$LYXVER" python -tt "/Applications/LyX.app/Contents/Resources/configure.py" popd else echo "This only works on a Mac" fi } If someone can come up with a clever way of finding the maJor and miNor versions of LyX, please let me know. Heartbleed was an OpenSSL vulnerability by the way, and, though Bashdoor was an issue in 2014, I use bash as my login shell so I don't really think it matters much. But as Steve wrote it's trivial to change. On 06/02/2019 10:49, Dr Eberhard Lisse wrote: [...] > On 06/02/2019 09:53, Steve Litt wrote: [...] >> Beware that pushd and popd are bash-only, and do not appear in dash or >> any /bin/sh one should be using for shellscripts. I'm of the opinion, >> especially after the Heartbleed fiasco, that bash is just too big an >> attack surface to use for shellscripts. >> >> In more lightweight shells, it's done more like this: >> >> #!/bin/sh >> orgdir=`pwd` >> cd /home/you/application/directory >> ./my_special_application arg1 arg2 arg3 >> cd $orgdir [...]
Re: Question: how to run Reconfigure without GUI
That was a first stab at it :-)-O When I have a moment I'll do it right :-)-O greetings, el On 06/02/2019 09:53, Steve Litt wrote: > On Tue, 5 Feb 2019 13:49:31 -0500 > Scott Kostyshak wrote: > >> On Tue, Feb 05, 2019 at 12:35:55PM +0200, Dr Eberhard Lisse wrote: >>> Scott, >>> >>> this is very helpful for my alias file on the Mac. >>> >>> function lyxconfigure >>> { >>> pushd ~/ >>> python -tt >>> "/Applications/LyX.app/Contents/Resources/configure.py" popd >>> } >> >> Nice. Thanks for sharing I actually never saw that trick for saving >> the directory in a bash function (I've only used pushd and popd >> interactively). I am used to saving "$(pwd)" to a variable and then >> "cd" back to it. I like your trick instead. > > Beware that pushd and popd are bash-only, and do not appear in dash or > any /bin/sh one should be using for shellscripts. I'm of the opinion, > especially after the Heartbleed fiasco, that bash is just too big an > attack surface to use for shellscripts. > > In more lightweight shells, it's done more like this: > > #!/bin/sh > orgdir=`pwd` > cd /home/you/application/directory > ./my_special_application arg1 arg2 arg3 > cd $orgdir > > SteveT >
Re: Question: how to run Reconfigure without GUI
On Tue, 5 Feb 2019 13:49:31 -0500 Scott Kostyshak wrote: > On Tue, Feb 05, 2019 at 12:35:55PM +0200, Dr Eberhard Lisse wrote: > > Scott, > > > > this is very helpful for my alias file on the Mac. > > > > function lyxconfigure > > { > > pushd ~/ > > python -tt > > "/Applications/LyX.app/Contents/Resources/configure.py" popd > > } > > Nice. Thanks for sharing I actually never saw that trick for saving > the directory in a bash function (I've only used pushd and popd > interactively). I am used to saving "$(pwd)" to a variable and then > "cd" back to it. I like your trick instead. Beware that pushd and popd are bash-only, and do not appear in dash or any /bin/sh one should be using for shellscripts. I'm of the opinion, especially after the Heartbleed fiasco, that bash is just too big an attack surface to use for shellscripts. In more lightweight shells, it's done more like this: #!/bin/sh orgdir=`pwd` cd /home/you/application/directory ./my_special_application arg1 arg2 arg3 cd $orgdir SteveT -- Steve Litt January 2019 featured book: Troubleshooting: Just the Facts http://www.troubleshooters.com/tjust
Re: Question: how to run Reconfigure without GUI
Le 05/02/2019 à 19:49, Scott Kostyshak a écrit : On Tue, Feb 05, 2019 at 12:35:55PM +0200, Dr Eberhard Lisse wrote: Scott, this is very helpful for my alias file on the Mac. function lyxconfigure { pushd ~/ python -tt "/Applications/LyX.app/Contents/Resources/configure.py" popd } Nice. Thanks for sharing I actually never saw that trick for saving the directory in a bash function (I've only used pushd and popd interactively). I am used to saving "$(pwd)" to a variable and then "cd" back to it. I like your trick instead. One can also do ( cd dir ; ./command ) But concerning the alias, I am a bit surprised because it seems to create files at the root of the home directory. JMarc
Re: Question: how to run Reconfigure without GUI
On Tue, Feb 05, 2019 at 12:35:55PM +0200, Dr Eberhard Lisse wrote: > Scott, > > this is very helpful for my alias file on the Mac. > > function lyxconfigure > { > pushd ~/ > python -tt "/Applications/LyX.app/Contents/Resources/configure.py" > popd > } Nice. Thanks for sharing I actually never saw that trick for saving the directory in a bash function (I've only used pushd and popd interactively). I am used to saving "$(pwd)" to a variable and then "cd" back to it. I like your trick instead. Scott signature.asc Description: PGP signature
Re: Question: how to run Reconfigure without GUI
Scott, this is very helpful for my alias file on the Mac. function lyxconfigure { pushd ~/ python -tt "/Applications/LyX.app/Contents/Resources/configure.py" popd } greetings, el On 15/01/2019 19:02, Scott Kostyshak wrote: > On Tue, Jan 15, 2019 at 11:27:34AM -0500, Daniel Gómez Martínez wrote: >> I found out I can start the action I want with "lyx -x reconfigure"; >> however, GUI is triggered at the end. > > You can call the configure script directly. For example, > > python -tt "/usr/local/share/lyx/configure.py" > > Be sure to run it inside your home directory. On Linux, this is ~/.lyx. > (note that you can set your home directory at run-time to any directory > when launching LyX) > > Best, > > Scott > signature.asc Description: OpenPGP digital signature
Re: Question: how to run Reconfigure without GUI
On Tue, Jan 15, 2019 at 11:27:34AM -0500, Daniel Gómez Martínez wrote: > I found out I can start the action I want with "lyx -x reconfigure"; > however, GUI is triggered at the end. You can call the configure script directly. For example, python -tt "/usr/local/share/lyx/configure.py" Be sure to run it inside your home directory. On Linux, this is ~/.lyx. (note that you can set your home directory at run-time to any directory when launching LyX) Best, Scott signature.asc Description: PGP signature
Re: Question: how to run Reconfigure without GUI
On 1/15/19 11:27 AM, Daniel Gómez Martínez wrote: I found out I can start the action I want with "lyx -x reconfigure"; however, GUI is triggered at the end. Already tried "lyx -batch -x reconfigure" but lyx ask for an input file, which I consider should not happen; I’m considering a bug report. I tried the same thing, with the same result (even if I surround "reconfigure" with quotes), so I agree that it's probably a bug.
Re: Question: how to run Reconfigure without GUI
I found out I can start the action I want with "lyx -x reconfigure"; however, GUI is triggered at the end. Already tried "lyx -batch -x reconfigure" but lyx ask for an input file, which I consider should not happen; I’m considering a bug report. Regards, *Daniel Gómez Martínez | Profesional en ingeniería eléctrica* *Universidad Nacional de Colombia* *Automatización industrial, ingeniería de patentes, instalaciones eléctricas.* *Sistemas de potencia, control de sistemas.* Tel: (+57) *312 824 8697 <3044313476>* El mar., 15 ene. 2019 a las 9:42, Daniel Gómez Martínez (< dangome...@gmail.com>) escribió: > Hello everyone, > > I was wondering if there's a way to execute Tools>Reconfigure without GUI > (i.e. from the terminal) in Linux. > > Thanks in advance, > > > *Daniel Gómez Martínez* > * <3044313476>* >
Question: how to run Reconfigure without GUI
Hello everyone, I was wondering if there's a way to execute Tools>Reconfigure without GUI (i.e. from the terminal) in Linux. Thanks in advance, *Daniel Gómez Martínez* * <3044313476>*