Article:
 |
|
Scripting Mac OS X
|
| Subject: |
|
end-of-line character and sudo |
| Date: |
|
2003-11-08 08:28:48 |
| From: |
|
hayne
|
|
|
A small correction:
The end-of-line-character in UNIX is ASCII 10 - not 8 as reported in the article. (man ascii)
And a recommendation:
The article suggested using 'sudo /bin/sh' in order to run a script as root. It would be better to use 'sudo' instead. You could do 'sudo name-of-script' and it would run as root. The use of 'sudo' for individual commands/scripts is generally recommended instead of running a shell as root. This limits exposure to problems and has the side benefit that everything you do is logged.
|
Showing messages 1 through 3 of 3.
-
end-of-line character and sudo
2003-11-10 13:45:39
jamesreynolds
[View]
-
end-of-line character and sudo
2003-11-10 11:46:25
anonymous2
[View]
-
end-of-line character and sudo
2004-01-01 13:34:15
anonymous2
[View]
If you were following the tutorial, and you wanted to execute each line in the terminal, you would type:
sudo rm -rf "/Users/labuser"
sudo ditto -rsrcFork "/System/Library/User Template/English.lproj" "/Users/labuser"
sudo chown -R <username>:staff "/Users/labuser"
instead of:
sudo /bin/sh
rm -rf "/Users/labuser"
ditto -rsrcFork "/System/Library/User Template/English.lproj" "/Users/labuser"
chown -R <username>:staff "/Users/labuser"