seduction
 Language:
Welcome, Guest. Please login or register.
Did you miss your activation email?
2017/04/26, 21:26:28


Help

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: [SOLVED] Flexible User  (Read 1104 times)

0 Members and 1 Guest are viewing this topic.

Offline tosidornottosid

  • User
  • Posts: 11
[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: 314
RE: Flexible User
« Reply #1 on: 2013/10/14, 11:44:16 »
can we not use "~/.wine" for  WINEPREFIX ?

Offline OppaErich

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

Offline tosidornottosid

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