diff --git a/SC2024.md b/SC2024.md index cc2322a..e75fc2c 100644 --- a/SC2024.md +++ b/SC2024.md @@ -1,7 +1,13 @@ # SC2024 sudo doesn't affect redirects. Use ..| sudo tee file -*** +## Problematic Code: -## Problematic code: +`sudo ls -hal /root/ > /root/test.out` -`sudo pv $VAR1 > $VAR2` \ No newline at end of file +## Correct Code: + +`sudo sh -c 'ls -hal /root/ > /root/test.out'` + +## Source + +[http://stackoverflow.com/a/82278](http://stackoverflow.com/a/82278) \ No newline at end of file