From 1b0b4d5e1cee96c1ba41a635807afae0ce381998 Mon Sep 17 00:00:00 2001 From: nathandarnell Date: Wed, 7 May 2014 17:16:17 -0700 Subject: [PATCH] Added what I found on the error from stackoverflow --- SC2024.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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