1 |
-----BEGIN PGP SIGNED MESSAGE----- |
2 |
Hash: SHA512 |
3 |
|
4 |
Would this be a case for "ps"? |
5 |
|
6 |
If you would like to know the PID of the process that calls your script you could execute "ps -o |
7 |
comm= $PPID" |
8 |
|
9 |
https://pubs.opengroup.org/onlinepubs/009604499/utilities/ps.html |
10 |
|
11 |
Rudi |
12 |
|
13 |
November 11, 2019 5:34 PM, "Jack" <ostroffjh@×××××××××××××××××.net> wrote: |
14 |
|
15 |
> On 11/11/19 12:38 PM, Walter Dnes wrote: |
16 |
> |
17 |
>> On Mon, Nov 11, 2019 at 04:37:17AM +0000, Caveman Al Toraboran wrote |
18 |
> |
19 |
> hi - is it possible to have some kind of fancy links that |
20 |
> know the name of the process that is trying to access |
21 |
> it, and based on its name, it links it to a file? |
22 |
>> Short answer... YES! Now convince the developers to use it. Here's a |
23 |
>> trivial example... |
24 |
>> |
25 |
>> * Create a 2-line executable script "foo" |
26 |
>> #!/bin/bash |
27 |
>> echo "${0}" |
28 |
>> |
29 |
>> * Create a symlink with the command "ln -s foo bar" |
30 |
>> |
31 |
>> * Execute "./foo" and the output will be "./foo" |
32 |
>> |
33 |
>> * Execute "./bar" and the output will be "./bar" |
34 |
> |
35 |
> That makes a distinction based on the name by which the script was called, not on the name of the |
36 |
> calling script. Caveman Al, have I misunderstood what your are asking for? |
37 |
> |
38 |
> Jack |
39 |
-----BEGIN PGP SIGNATURE----- |
40 |
Version: Keybase OpenPGP v2.1.3 |
41 |
Comment: https://keybase.io/crypto |
42 |
|
43 |
wsFcBAABCgAGBQJdyq9EAAoJEO9k88vRoevdQLUP/RTw4j7pwVpehYcElbrJ1KdI |
44 |
5W9Jyx2x8rr3JQz0s3YYehp/WZITKWLiIj4ho3FuHXWRVr+4ncl1s2NMJ9FR2GLV |
45 |
aquB4G+6t4n0dUIiVOKXnIl9vT9fRvS3yLby77dO9mMdoU6EjUSSYFxLC1F51rpj |
46 |
FjrF2wiT3aGb0lEunEF2ZGMXwoLCbRw88bfovFq4CiU5nteMBfcbp/FH0X9nyyEJ |
47 |
eL8855Jojd+KZLazJEKpGQob2dzvJQ/l9KE1dLy2NUu57OSBIh20WsZoAN89G7dR |
48 |
DWG70ywdivTpMmHooegpRxbMXrDZx662iSnWcERddG2vcirIisYhhlh8qgQYn83n |
49 |
Q/HSvKDp/o+kkkav25TYiKUBV6nT/t6WvFbXoz8WDJKErFbMBobBD8H3mqclL4OF |
50 |
3nyXVniD2dfVeR/pGu1U0iI5+kLBt+GKv7l01LhfenOF/Hsm0qAbaH+523BggCMH |
51 |
Ak6/Ec3GU7qV5QNAqdFFlpvIP3VzfbTHEaDDbPfSBAENJD7GrBfUanxFtIs9LpS8 |
52 |
JtJKC/b/CWiK0jnAGe6yC8yqRb5qjtz60GWSFZPKVoSdwdsMlIJ4XmmLZHDtncQh |
53 |
87BiEG2Tt3QobekaYqv6/fGA7g6tn9xAZWQpgpImM8kDAlLFtBr4uTa4Fq9V/hFI |
54 |
qVwD3XtUKn+TD0vC+cYc |
55 |
=loNt |
56 |
-----END PGP SIGNATURE----- |