seduction
Language:
EN
DE
Siduction Forum
»
Siduction Forum
»
Scripting & Kernelhacking
»
Scripting & Kernelhacking (EN)
»
[SOLVED] Flexible User
manual
news
wiki
bugs
git
gallery
packages
download
donate
imprint
Advanced search
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
2021/01/18, 08:23:25
1 Hour
1 Day
1 Week
1 Month
Forever
Links
Debian Transitions
New/Byhand
Distrowatch
Google+
Help
Help
Contact
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [SOLVED] Flexible User (Read 3371 times)
0 Members and 1 Guest are viewing this topic.
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!
Logged
absolut
User
Posts: 443
RE: Flexible User
«
Reply #1 on:
2013/10/14, 11:44:16 »
can we not use "~/.wine" for WINEPREFIX ?
Logged
OppaErich
OLE
User
Posts: 377
RE: Flexible User
«
Reply #2 on:
2013/10/14, 11:51:04 »
or /home/$USER/.wine
Logged
tosidornottosid
User
Posts: 11
RE: Flexible User
«
Reply #3 on:
2013/10/15, 07:55:13 »
Yes. It worked.
Thank you both!
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
Siduction Forum
»
Siduction Forum
»
Scripting & Kernelhacking
»
Scripting & Kernelhacking (EN)
»
[SOLVED] Flexible User