0

I have this on a file:

github - https://github.com/search?q=
google - https://www.google.com/search?q=
pixabay - https://www.pixabay.com//es/images/search/
map - https://www.google.com/maps/place/
giff - https://giphy.com/search/

I want to get the first column on a dmenu list. I can get this by: awk '{print $1}' file | dmenu that gives me the first result(column), but I need to pass the las column (the actual url). In other words, I want to hide the url when launching dmenu. Fzf has an option that makes possible this very easy: echo file|fzf --with-nth=1 | awk '{print $3}'.

testoflow
  • 17
  • 7
  • did you try passing the first word to dmenu, then grep the "dmenu answer" in your menu file and select the third field? – λuser Mar 14 '21 at 11:15
  • `a=$(cut -d ' ' -f1 base | dmenu -l 20 ) && grep $a base | awk '{print $3}'` The problem is when I have more than one result – testoflow Mar 15 '21 at 20:03
  • try `grep "^$a -" base` to clamp the search to the start of lines and force the whole word thanks to searching the dash separator. – λuser Mar 17 '21 at 08:10

0 Answers0