fzf: allow trimmed url [closed]











up vote
-1
down vote

favorite












I trimmed url with this command (it's too long to display on screen)



echo 'https://example.com' | awk -v len=10 -F 't' 'BEGIN { OFS=FS  } { for (i=1; i<=NF; ++i) if (length($i)>len) $i = substr($i,1,len-3) "»"  }; 1'
https:/»


Then I pipe the output to fzf, how to make fzf understand the original url, I then take some actions on the full url - e.g: open the url link.



EDIT: the point is it's probably need some work from fzf to support this feature, it's only possible if we save orginal url somewhere before trimming but a support from fzf to trim url is more elegant.










share|improve this question















closed as unclear what you're asking by Michael Homer, Jeff Schaller, RalfFriedl, G-Man, Stephen Harris Dec 2 at 4:00


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 1




    Kindly mentioned what is expected output from input give
    – Praveen Kumar BS
    Dec 1 at 6:58










  • How in the world is fzf supposed to "understand" the original URL when you don't give it the original URL?
    – G-Man
    Dec 2 at 3:55










  • @G-Man: That's why I need support from fzf itself. Question gives representation of trimmed url that without support form fzf, fzf can't understand it.
    – Tuyen Pham
    Dec 2 at 11:48










  • You're missing my point.  If I'm thinking of a sentence, and I tell you that the first two words are "The cat", can you determine the rest of the sentence?  Of course not.  So my point is, how is it even theoretically possible for any piece of software to reconstruct information that it hasn't been given?
    – G-Man
    Dec 2 at 17:49












  • @G-Man: I understand what you're mentioning. I've just updated the question, I really don't want to trim and force fzf to understand the trimmed url, the question is about how to display trimmed url and do some actions on the original one that have support from fzf itself. So is it possible with fzf to do that? I found that currently It could not.
    – Tuyen Pham
    Dec 3 at 1:43

















up vote
-1
down vote

favorite












I trimmed url with this command (it's too long to display on screen)



echo 'https://example.com' | awk -v len=10 -F 't' 'BEGIN { OFS=FS  } { for (i=1; i<=NF; ++i) if (length($i)>len) $i = substr($i,1,len-3) "»"  }; 1'
https:/»


Then I pipe the output to fzf, how to make fzf understand the original url, I then take some actions on the full url - e.g: open the url link.



EDIT: the point is it's probably need some work from fzf to support this feature, it's only possible if we save orginal url somewhere before trimming but a support from fzf to trim url is more elegant.










share|improve this question















closed as unclear what you're asking by Michael Homer, Jeff Schaller, RalfFriedl, G-Man, Stephen Harris Dec 2 at 4:00


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 1




    Kindly mentioned what is expected output from input give
    – Praveen Kumar BS
    Dec 1 at 6:58










  • How in the world is fzf supposed to "understand" the original URL when you don't give it the original URL?
    – G-Man
    Dec 2 at 3:55










  • @G-Man: That's why I need support from fzf itself. Question gives representation of trimmed url that without support form fzf, fzf can't understand it.
    – Tuyen Pham
    Dec 2 at 11:48










  • You're missing my point.  If I'm thinking of a sentence, and I tell you that the first two words are "The cat", can you determine the rest of the sentence?  Of course not.  So my point is, how is it even theoretically possible for any piece of software to reconstruct information that it hasn't been given?
    – G-Man
    Dec 2 at 17:49












  • @G-Man: I understand what you're mentioning. I've just updated the question, I really don't want to trim and force fzf to understand the trimmed url, the question is about how to display trimmed url and do some actions on the original one that have support from fzf itself. So is it possible with fzf to do that? I found that currently It could not.
    – Tuyen Pham
    Dec 3 at 1:43















up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I trimmed url with this command (it's too long to display on screen)



echo 'https://example.com' | awk -v len=10 -F 't' 'BEGIN { OFS=FS  } { for (i=1; i<=NF; ++i) if (length($i)>len) $i = substr($i,1,len-3) "»"  }; 1'
https:/»


Then I pipe the output to fzf, how to make fzf understand the original url, I then take some actions on the full url - e.g: open the url link.



EDIT: the point is it's probably need some work from fzf to support this feature, it's only possible if we save orginal url somewhere before trimming but a support from fzf to trim url is more elegant.










share|improve this question















I trimmed url with this command (it's too long to display on screen)



echo 'https://example.com' | awk -v len=10 -F 't' 'BEGIN { OFS=FS  } { for (i=1; i<=NF; ++i) if (length($i)>len) $i = substr($i,1,len-3) "»"  }; 1'
https:/»


Then I pipe the output to fzf, how to make fzf understand the original url, I then take some actions on the full url - e.g: open the url link.



EDIT: the point is it's probably need some work from fzf to support this feature, it's only possible if we save orginal url somewhere before trimming but a support from fzf to trim url is more elegant.







linux text-processing awk command-line pipe






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 3 at 1:40

























asked Nov 30 at 20:02









Tuyen Pham

545113




545113




closed as unclear what you're asking by Michael Homer, Jeff Schaller, RalfFriedl, G-Man, Stephen Harris Dec 2 at 4:00


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by Michael Homer, Jeff Schaller, RalfFriedl, G-Man, Stephen Harris Dec 2 at 4:00


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 1




    Kindly mentioned what is expected output from input give
    – Praveen Kumar BS
    Dec 1 at 6:58










  • How in the world is fzf supposed to "understand" the original URL when you don't give it the original URL?
    – G-Man
    Dec 2 at 3:55










  • @G-Man: That's why I need support from fzf itself. Question gives representation of trimmed url that without support form fzf, fzf can't understand it.
    – Tuyen Pham
    Dec 2 at 11:48










  • You're missing my point.  If I'm thinking of a sentence, and I tell you that the first two words are "The cat", can you determine the rest of the sentence?  Of course not.  So my point is, how is it even theoretically possible for any piece of software to reconstruct information that it hasn't been given?
    – G-Man
    Dec 2 at 17:49












  • @G-Man: I understand what you're mentioning. I've just updated the question, I really don't want to trim and force fzf to understand the trimmed url, the question is about how to display trimmed url and do some actions on the original one that have support from fzf itself. So is it possible with fzf to do that? I found that currently It could not.
    – Tuyen Pham
    Dec 3 at 1:43
















  • 1




    Kindly mentioned what is expected output from input give
    – Praveen Kumar BS
    Dec 1 at 6:58










  • How in the world is fzf supposed to "understand" the original URL when you don't give it the original URL?
    – G-Man
    Dec 2 at 3:55










  • @G-Man: That's why I need support from fzf itself. Question gives representation of trimmed url that without support form fzf, fzf can't understand it.
    – Tuyen Pham
    Dec 2 at 11:48










  • You're missing my point.  If I'm thinking of a sentence, and I tell you that the first two words are "The cat", can you determine the rest of the sentence?  Of course not.  So my point is, how is it even theoretically possible for any piece of software to reconstruct information that it hasn't been given?
    – G-Man
    Dec 2 at 17:49












  • @G-Man: I understand what you're mentioning. I've just updated the question, I really don't want to trim and force fzf to understand the trimmed url, the question is about how to display trimmed url and do some actions on the original one that have support from fzf itself. So is it possible with fzf to do that? I found that currently It could not.
    – Tuyen Pham
    Dec 3 at 1:43










1




1




Kindly mentioned what is expected output from input give
– Praveen Kumar BS
Dec 1 at 6:58




Kindly mentioned what is expected output from input give
– Praveen Kumar BS
Dec 1 at 6:58












How in the world is fzf supposed to "understand" the original URL when you don't give it the original URL?
– G-Man
Dec 2 at 3:55




How in the world is fzf supposed to "understand" the original URL when you don't give it the original URL?
– G-Man
Dec 2 at 3:55












@G-Man: That's why I need support from fzf itself. Question gives representation of trimmed url that without support form fzf, fzf can't understand it.
– Tuyen Pham
Dec 2 at 11:48




@G-Man: That's why I need support from fzf itself. Question gives representation of trimmed url that without support form fzf, fzf can't understand it.
– Tuyen Pham
Dec 2 at 11:48












You're missing my point.  If I'm thinking of a sentence, and I tell you that the first two words are "The cat", can you determine the rest of the sentence?  Of course not.  So my point is, how is it even theoretically possible for any piece of software to reconstruct information that it hasn't been given?
– G-Man
Dec 2 at 17:49






You're missing my point.  If I'm thinking of a sentence, and I tell you that the first two words are "The cat", can you determine the rest of the sentence?  Of course not.  So my point is, how is it even theoretically possible for any piece of software to reconstruct information that it hasn't been given?
– G-Man
Dec 2 at 17:49














@G-Man: I understand what you're mentioning. I've just updated the question, I really don't want to trim and force fzf to understand the trimmed url, the question is about how to display trimmed url and do some actions on the original one that have support from fzf itself. So is it possible with fzf to do that? I found that currently It could not.
– Tuyen Pham
Dec 3 at 1:43






@G-Man: I understand what you're mentioning. I've just updated the question, I really don't want to trim and force fzf to understand the trimmed url, the question is about how to display trimmed url and do some actions on the original one that have support from fzf itself. So is it possible with fzf to do that? I found that currently It could not.
– Tuyen Pham
Dec 3 at 1:43

















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Morgemoulin

Scott Moir

Souastre