It turned out that echo -n trick isn't correct neither. I've decided to add the second condition for empty string, so the final version is:
echo -n
TO_REMOVE=`git clean -f -d -n`; if [[ "$TO_REMOVE" != "" ]] && [[ `echo $TO_REMOVE | wc -l | bc` != "0" ]]; then
What about wc -l "$TO_REMOVE"?
wc -l "$TO_REMOVE"
I don't think it gonna work. It tries to read a file under the path saved in $TO_REMOVE variable. That's not what we want to do.
$TO_REMOVE
Oh interesting. Never mind then. Thanks for helping me understand all of this.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It turned out that
echo -n
trick isn't correct neither. I've decided to add the second condition for empty string, so the final version is:What about
wc -l "$TO_REMOVE"
?I don't think it gonna work. It tries to read a file under the path saved in
$TO_REMOVE
variable. That's not what we want to do.Oh interesting. Never mind then. Thanks for helping me understand all of this.