In my previous question I created a command that reverts svn files by pattern:
svn st | grep SomeFolderA | awk {'print $2'} | xargs svn revert
Now I want to make it a command that accepts argument (file pattern) and runs the above command by using the argument instead of SomeFolderA
. I tried adding this to my .bash_profile
file:
function revert() {
"svn st | grep '$1' | awk '{print \$2}' | xargs svn revert" ;
}
When I run revert SomeFolderA
I get this output:
-bash: svn st | grep 'SomeFolderA/' | awk '{print $2}' | xargs svn revert: No such file or directory
I also tried using the complete path for the svn
but it still doesn't work. What am I missing?