Customizing the location of the .sqlite_history

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Customizing the location of the .sqlite_history

Jes Slow
Hi - this is kind of a trivial request, but .sqlite_history is one of the
relatively few files that I can't move into ~/.config folder (or wherever
it fits).

We know that globals can become messy as you scale, and up until the XDG
standard applications treated the home folder as their global place to drop
configuration files. When you have dozens of programs, that starts to get
messy.

Many applications do this by allowing the user to set an environment
variable to customize the location, altho personally I would prefer another
way since environment variables are also global. Hope you consider it.
Thanks
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Customizing the location of the .sqlite_history

Rowan Worth
sqlite3() {
    confs='.sqlite_history .sqliterc'
    for c in $confs; do ln -s ~/.config/$c ~/$c; done
    (sleep 10; cd; rm $confs)&
    command sqlite3 "$@"
}

Alternately, simply create a new user with home directory matching your
~/.config, and su to that user to run sqlite3.

(no, neither of these suggestions are serious :P)
-Rowan

On 1 February 2016 at 13:46, Jes Slow <[hidden email]> wrote:

> Hi - this is kind of a trivial request, but .sqlite_history is one of the
> relatively few files that I can't move into ~/.config folder (or wherever
> it fits).
>
> We know that globals can become messy as you scale, and up until the XDG
> standard applications treated the home folder as their global place to drop
> configuration files. When you have dozens of programs, that starts to get
> messy.
>
> Many applications do this by allowing the user to set an environment
> variable to customize the location, altho personally I would prefer another
> way since environment variables are also global. Hope you consider it.
> Thanks
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Customizing the location of the .sqlite_history

James K. Lowden
In reply to this post by Jes Slow
On Sun, 31 Jan 2016 21:46:18 -0800
Jes Slow <[hidden email]> wrote:

> Many applications do this by allowing the user to set an environment
> variable to customize the location, altho personally I would prefer
> another way since environment variables are also global.

Global?  Environment variables are per-process, and changeable by the
process with putenv(3).  

--jkl
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Customizing the location of the .sqlite_history

Keith Medcalf

> Jes Slow <[hidden email]> wrote:
>
> > Many applications do this by allowing the user to set an environment
> > variable to customize the location, altho personally I would prefer
> > another way since environment variables are also global.
>
> Global?  Environment variables are per-process, and changeable by the
> process with putenv(3).

Each process when it starts gets a "copy" of its parent process environment, which it may modify and will be "copied" to its children.  The "first process" creates the "first environment" by copying from its parent (NUL) and passing its modifications along to its children.







_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users