Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
27
rated 0 times [  27] [ 0]  / answers: 1 / hits: 5541  / 2 Years ago, wed, september 28, 2022, 11:58:24

I am actually playing with arguments and its happened. I just thought like to see what will happen if I type $$1 and I did it and got something below.



raja@raja-BONEFISH:~$ $$1
19301: command not found


What's that 19301 mean, is it telling something?



Bottom-Line: what does meaning for $$1 in bash.


More From » bash

 Answers
3

$$ is the PID (process id) of the current process.



$$1 is the above PID followed by the literal string 1.



So it is telling you that your bash is the process with PID 1930.



But... free trick:



show() { eval echo $$1; }
show PATH
/home/romano/bin:/usr/local/bin:/bin:/usr/bin


(quite convoluted, ain't it?)



More info in TLDP.


[#25102] Friday, September 30, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
saucdisr

Total Points: 4
Total Questions: 102
Total Answers: 117

Location: Ecuador
Member since Thu, Jun 4, 2020
4 Years ago
;