zephyr@lemmy.world to Programming@programming.dev · 2 years agoHow do you shell expand your variables and why?lemmy.worldimagemessage-square24fedilinkarrow-up155arrow-down13
arrow-up152arrow-down1imageHow do you shell expand your variables and why?lemmy.worldzephyr@lemmy.world to Programming@programming.dev · 2 years agomessage-square24fedilink
minus-squareilega_dh@feddit.nllinkfedilinkarrow-up32·2 years agofind “$(echo $HOME > variable_holder.txt && cat variable_holder.txt)/$(cat alphabet.txt | grep “d”) $(cat alphabet.txt | grep “o”)$(cat alphabet.txt | grep “c”)$(cat alphabet.txt | grep “s”)” This is the easiest method
minus-squareEager Eagle@lemmy.worldlinkfedilinkEnglisharrow-up7·2 years agowhen you’re paid by character written
minus-squarethingsiplay@kbin.sociallinkfedilinkarrow-up4arrow-down2·edit-22 years ago@ilega_dh You don’t need cat in cases when grep "d" alphabet.txt can read from file too. Edit: But obviously your comment was more of a joke to over complicate it. So never mind then.
minus-squaregendulf@kbin.sociallinkfedilinkarrow-up3·2 years agoTo be safe, should probably output grep to a file, then cat that.
minus-squareilega_dh@feddit.nllinkfedilinkarrow-up1·2 years agoAgreed. Everything in Linux is a file so let’s keep it that way.
minus-squareImpossibleRubiksCube@programming.devlinkfedilinkarrow-up3·edit-22 years agodeleted by creator
minus-squaremonsterpiece42@reddthat.comlinkfedilinkarrow-up1·2 years agoWhat should I search to better understand what is written here? Don’t mind learning myself, just looking for the correct keywords. Thanks!
minus-squaremarcos@lemmy.worldlinkfedilinkarrow-up2·2 years agoRead the Bash manual. That one patter on the GP is called “Command Substitution”, you can search for it.
find “$(echo $HOME > variable_holder.txt && cat variable_holder.txt)/$(cat alphabet.txt | grep “d”) $(cat alphabet.txt | grep “o”)$(cat alphabet.txt | grep “c”)$(cat alphabet.txt | grep “s”)”
This is the easiest method
when you’re paid by character written
deleted by creator
This really enterprises my bash.
@ilega_dh You don’t need
catin cases whengrep "d" alphabet.txtcan read from file too. Edit: But obviously your comment was more of a joke to over complicate it. So never mind then.To be safe, should probably output grep to a file, then cat that.
Agreed. Everything in Linux is a file so let’s keep it that way.
deleted by creator
What should I search to better understand what is written here? Don’t mind learning myself, just looking for the correct keywords. Thanks!
Read the Bash manual. That one patter on the GP is called “Command Substitution”, you can search for it.
Thanks!
ExplainShell should help