How can I save the output of this command into a var and still remove the files?rm -vri files | wc -l
BASH How to save the output of rm -vri to a var
bash;shell;shell script
Since the question is very precise, the answer is shortVAR=$(rm -vri files | wc -l)Update just in case one has more interest on the subject, here is the link to command substitution