![]() p again, "by process id" and in bash $$ is the process id. ![]() o list of keywords, only one keyword as before, but ppid= this is asking directly for process id of parent shell!! From WITHIN DAUGHTER SHELL! Very clever, yes? I am so excited when I can understand this! OK, so now we are running almost identical command again, ps -o 'ppid=' -p $$ but this time ps, process status, shows us what he can see from within daughter shell instance. So, $(foo -opt bar) expands "foo -opt bar" as run in daughter shell. But in bash, single round brace (.) opens subshell. So, $(foo -opt bar) will unwrap, or expand, "foo -opt bar". So we know $ is expansion operator in bash. What we can do, is to understand it now, because I will explain. Those guys are awesome, but many times I cannot understand what they say to do until after much study. I think I stole it from somewhere, I could not find again. I wish I invented this bash one-liner, but I did not. Here we must start to think a little deeper. ACTUALLY EXIT GUAKE HOW TOSo, how to get process id? We unwrap expression $(ps -o 'ppid=' -p $$) Problem is, you must pass to ps this process id. Ps option -p is "by process id" Wow this is very nice option for ps. So, just asking to display command to open terminal. ![]() So, (list of keywords) is 'cmd=' Only one keyword in list. (space or comma) separated (list of keywords) specified. Ps option -o is Display information associated with the space orĬomma separated list of keywords specified. On many linux system echo $TERM return xterm see stazher post above.ġ: Close every terminal instance currently running.Ģ: Open new terminal using your usual method. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |