[elinks-users] elinks.conf file

Fabienne Ducroquet fabiduc at gmail.com
Mon Jul 16 11:40:34 PDT 2012

Le lundi 16 juillet 2012, Gray, Steve, Wipro a écrit :
> Hello,
> I do have my variable exported in my .profile.  Plus, I did try to use 
> the -config-dir option.  In my configuration (along with other stuff), 
> I have --prefix=/opt/tribily/bin/elinks \
>         -config-dir="/opt/tribily/bin/elinks" \
> But I get the error: configure: error: unrecognized option: -config-dir=/opt/tribily/bin/elinks
> Try `./configure --help' for more information.
> And when I run the "./configure --help", there is no information about the 
> "-config-dir" option.  How do I set up that option?  I would like to be in 
> a position where I can use either the wget command or use elinks.

You are confusing different things:
– The compilation options, which you pass to the ./configure script that you run 
  before compiling with make.
  They are listed by ./configure --help and --prefix is one of them. Some of 
  them (but not --prefix) can also be set in the features.conf file. They are 
  used to specify what features you want to enable and where you want to install 
  the files created. They are needed only for compilation and installation, you 
  don’t need to have access to them afterwards (but you can find what options 
  you used by grepping for ./configure in config.log, and if you compile several 
  times without running ./configure in between the same options will be used 
  each time).
– The runtime options, which you pass to the elinks executable, -config-dir is 
  one of them.
  They are documented in elinks’s manpage. Note that the syntax is slightly 
  different from that of ./configure options: you have to write -config-dir 
  /opt/tribily/bin/elinks, without an equal sign.
– The options stored (by default) in the configuration file elinks.conf, which 
  you can edit manually or by using the options manager available in elinks’s 
  menu. They are the same as the "Preferences" or "Settings" that you find in 
  most graphical programs.

    So to use the -config-dir option you have to add it to the command line in 
the script, so it becomes (split on several lines for readability):
    /opt/tribily/bin/elinks/src/elinks -config-dir /opt/tribily/bin/elinks \
    -source "http://$HOST:$PORT/nginx_status" \
    | grep 'Reading' | awk '{print $2}

With this you don’t need to set the ELINKS_CONFDIR variable anymore.

    But if I understand correctly, you don’t really need to use that particular 
configuration directory, you could just let elinks use the default value, it 
will create a .elinks directory in your $HOME and store some files there. You 
can even disable that with the -no-home option, because for your usage you don’t 
need to store bookmarks, history, cookies, etc.

    Actually, you may not need to use --prefix either, since it is only useful 
when you install the files (with "make install"), and it seems that you are 
compiling in /opt/tribily/bin/elinks and directly using the executable without 
installing it. But if I were you, I would rather (assuming you have the 
necessary permissions):
– Move the whole /opt/tribily/bin/elinks directory elsewhere, because I would 
  expect /opt/tribily/bin to contain binary files related to tribily rather than 
  the sources of another program, so I’d put this directory directly in /opt, or 
  /opt/src, or my home directory if nobody else needs to have access to the 
– Configure and compile elinks with --prefix=/opt, or --prefix=/usr/local, or 
  --prefix=$HOME if I want to install it for myself only, and install it.
– Check that /opt/bin, or /usr/local/bin, or $HOME/bin, is in the $PATH, and 
  that /opt/share/man, or /usr/local/share/man, or $HOME/share/man is in the 
    If you do that, you can then use elinks like any other program, without 
having to tell explicitly to the shell where to find it, so in your script you 
can replace "/opt/tribily/bin/elinks/src/elinks" with simply "elinks".

    One further remark: I read again the error message you got, which was:
> ERROR at home.c:149: Unable to find or create ELinks config directory. Please 
> check if you have $HOME variable set correctly and if you have write 
> permission to your home directory
    This message means that ELinks was trying to access the $HOME of the user it 
was running as (the message would have been different if it was trying to access 
/opt/tribily/bin/elinks), so we can deduce from this:
– that it didn’t have access to the ELINKS_CONFDIR variable;
– that it either didn’t find the $HOME, or couldn’t write to it.
    So there must be a problem somewhere, which user is your script running as? 
If it’s you, the $HOME variable must have been modified somewhere, if it’s 
a user with no $HOME where it can write, then it changes a little what I wrote 
above (where I assumed that the script was run by a regular user, with a $HOME, 
etc.): it can’t access your .profile, $PATH, etc., so if you want to set 
variables you have to do so in the script or change the system-wide environment, 
and also in that case it is probably better to use -no-home.


More information about the elinks-users mailing list