How can I use the output of one command - line-by-line - into another command? I know how to do this with the |
pipe symbol, but this uses the entire output in one command. I would like to go line by line... I think I need to combine the |
and xargs
but not sure.
redis-cli keys \* | redis-cli get [key would go here]
read
always going to be in those types of commands? – d-_-b Dec 06 '13 at 02:35read
can be used in a lot of instances. For example, as a standalone to take input and assign to a variable (with a prompt):read -p "Enter a name: " name
- the value entered will then be assigned to$name
. – laebshade Dec 06 '13 at 02:37read
is also handy to assign words in a string to variables:x="1 2 3 4 5"; read a b c rest <<< "$x"
– glenn jackman Dec 06 '13 at 02:47