how to use/get a section from selection #3485
Answered
by
LangLangBart
daniejstriata
asked this question in
Q&A
-
I have a list of servers with hostname, IP, location and description separated with = (but could be anything) How can I make a selection with fzf but have it only use the hostname section to call ssh? All the solutions I've found so far would cut off the other fields and therefore not get displayed.
|
Beta Was this translation helpful? Give feedback.
Answered by
LangLangBart
Oct 24, 2023
Replies: 1 comment 1 reply
-
cat servers.txt |
fzf --delimiter '=' --preview 'echo {1};echo {2};echo {3}' --preview-window nohidden
cat servers.txt |
fzf --delimiter '=' --bind 'enter:become:echo I have selected: {1}' |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
daniejstriata
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
delimiter
flag andFIELD INDEX EXPRESSION
man fzf
{}
{2}
{2..}
+
f
s
fzf
you can then define a hotkey to perform anaction
, for exampleexecute
orbecome
fzf's
man page and the the CHANGELOG.md will helpcat servers.txt | fzf --delim…