Unfortunately or sadly, this could not be done by me for my use case in Bash. I'm looking for a good solution in Bash too. Just to note here.
To read from the pipe you just have to use the Read command. It only works this way in Zsh so far.
blkid $dev | sed -n 's/.*UUID=\"\([^\"]*\)\".*/\1/p' | read var;Now you can easily use that $var in that scope like
echo $var
No comments:
Post a Comment
Post your comment here. If you want to say something about programming problems, scripts, software etc, please try to be as descriptive as possible.