Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] [SOLVED] Flexible User  (Read 5964 times)

tosidornottosid

  • Guest
[EN] [SOLVED] Flexible User
« on: 2013/10/14, 09:08:35 »
Good Day to All!

Let us say that we have a standalone Windows program and we want to run it with a script. Suppose we are User 1 and we "exist" in /home/user1

We create our script, e.g.

#!/bin/sh

cd `dirname "$0"`

env WINEPREFIX="/home/user1/.wine" wine program.exe

It works. But there is no flexibility in the user path. That is, if we install the system again or to another computer and we deside to change the username to John Smith, we have to edit the script accordingly:

#!/bin/sh

cd `dirname "$0"`

env WINEPREFIX="/home/johnsmith/.wine" wine program.exe

One can observe that the command cd `dirname "$0"`
is very "flexible": there is no need to type a specific directory path. The folder containing the standalone program can be put anywhere.

Is there a way to achieve similar flexibility with the user name, so one does not need to edid the script every time the username changes?

Thanks!

Offline absolut

  • User
  • Posts: 454
RE: Flexible User
« Reply #1 on: 2013/10/14, 11:44:16 »
can we not use "~/.wine" for  WINEPREFIX ?

Offline OppaErich

  • OLE
  • User
  • Posts: 381
RE: Flexible User
« Reply #2 on: 2013/10/14, 11:51:04 »
or /home/$USER/.wine

tosidornottosid

  • Guest
RE: Flexible User
« Reply #3 on: 2013/10/15, 07:55:13 »
Yes. It worked.
Thank you both!