mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2024 (markdown)
@@ -2,12 +2,8 @@
|
|||||||
|
|
||||||
## Problematic Code:
|
## Problematic Code:
|
||||||
|
|
||||||
`sudo ls -hal /root/ > /root/test.out`
|
sudo echo 'export FOO=bar' > /etc/profile
|
||||||
|
|
||||||
## Correct Code:
|
## Correct Code:
|
||||||
|
|
||||||
`sudo sh -c 'ls -hal /root/ > /root/test.out'`
|
echo 'export FOO=bar' | sudo tee /etc/profile > /dev/null
|
||||||
|
|
||||||
## Source
|
|
||||||
|
|
||||||
[http://stackoverflow.com/a/82278](http://stackoverflow.com/a/82278)
|
|
||||||
|
Reference in New Issue
Block a user