vendredi 26 juin 2015

Passing pipe output to Test command

I'm confused with test command syntax. My goal is to check if file exists, but file path formed by sed command.

So, I try, for example:

echo '~/test111' | sed s/111/222/g | test -f && echo "found" || echo "not found"

But that command always returns "found". What am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire