Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

16
  • 2
    Which bash version? I cannot reproduce, also the pipeline could be something like awk -v user="$USER" '$0 ~ user { print $NF; exit }' untested though. Commented May 1 at 0:21
  • bash 5.2.21 & .37. I'll see if I can try in others. Good tip to fork fewer processes. Commented May 1 at 0:36
  • I see you have escaped one alias in \ls. Any other aliases you might have forgotten to escape? Commented May 1 at 0:46
  • I also cannot reproduce (bash 5.2.37). Does it still reproduce if you run it inside bash --norc --noprofile? I suspect something from your .bashrc is necessary to reproduce Commented May 1 at 0:50
  • I think you're right @ComputerDruid. I couldn't reproduce when logging in with a different SSH client. I'll have to isolate the cause and update/answer/delete the question. Commented May 1 at 1:36