Gentoo Archives: gentoo-user

From: Jack <ostroffjh@×××××××××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] links that behave differently per calling app?
Date: Mon, 11 Nov 2019 22:34:35
Message-Id: d5e8468a-a39f-4c49-b20d-6b5c6fd94126@users.sourceforge.net
In Reply to: Re: [gentoo-user] links that behave differently per calling app? by Walter Dnes
1 On 11/11/19 12:38 PM, Walter Dnes wrote:
2 > On Mon, Nov 11, 2019 at 04:37:17AM +0000, Caveman Al Toraboran wrote
3 >> hi - is it possible to have some kind of fancy links that
4 >> know the name of the process that is trying to access
5 >> it, and based on its name, it links it to a file?
6 > Short answer... YES! Now convince the developers to use it. Here's a
7 > trivial example...
8 >
9 > * Create a 2-line executable script "foo"
10 > #!/bin/bash
11 > echo "${0}"
12 >
13 > * Create a symlink with the command "ln -s foo bar"
14 >
15 > * Execute "./foo" and the output will be "./foo"
16 >
17 > * Execute "./bar" and the output will be "./bar"
18
19 That makes a distinction based on the name by which the script was
20 called, not on the name of the calling script.  Caveman Al, have I
21 misunderstood what your are asking for?
22
23 Jack

Replies