Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > any "sudo" command experts?

any "sudo" command experts?
Thread Tools
pwrmacg4
Forum Regular
Join Date: Jan 2005
Status: Offline
Reply With Quote
Nov 19, 2010, 02:32 AM
 
I want to type this:
sudo mv \
/System/Library/Services/AppleSpell.service/Contents/Resources/en_GB.lproj \
/System/Library/Services/AppleSpell.service/Contents/Resources/en_GB.lproj.disabled
----------------------
Below "sudo mv \"
do I type the rest in on one line (allowing wrap-around)?
how is "\" or "/" used next to each other? Is there space between the bottom 2 lines? (/System/Library...)
     
AKcrab
Moderator Emeritus
Join Date: Apr 2001
Location: Wasilla, Alaska
Status: Offline
Reply With Quote
Nov 19, 2010, 03:38 AM
 
It should be:
Code:
sudo mv /System/Library/Services/AppleSpell.service/Contents/Resources/en_GB.lproj /System/Library/Services/AppleSpell.service/Contents/Resources/en_GB.lproj.disabled
You should be able to copy and paste that whole line, and press return.
     
MarkLT1
Mac Enthusiast
Join Date: Nov 2002
Location: More Cowbell...
Status: Offline
Reply With Quote
Nov 19, 2010, 04:23 PM
 
actually, either is acceptable. \<newline> is a line continuation in bash:

Originally Posted by bash man page
A non-quoted backslash (\) is the escape character. It preserves the literal value of the next character that follows, with the exception of <newline>. If a \<newline> pair appears, and the backslash is not itself quoted, the \<newline> is treated as a line continuation (that is, it is removed from the input stream and effectively ignored).
Thus, one can use \<newline> to put long commands/arguments on multiple lines. e.g.:

Code:
ls -l
is the same as:
Code:
ls \ -l
So for the OP, if you wanted to input the way you have shown in your post you would enter the command like:
Code:
sudo mv \<return> /System/Library/Services/AppleSpell.service/Contents/Resources/en_GB.lproj \<return> /System/Library/Services/AppleSpell.service/Contents/Resources/en_GB.lproj.disabled<return>
(dont type <return>, but rather hit the return key.)
     
Dork.
Professional Poster
Join Date: Sep 2005
Location: Rochester, NY
Status: Offline
Reply With Quote
Nov 19, 2010, 04:28 PM
 
Since you question had been answered seriously, I can provide the obligatory humor:

     
jmiddel
Grizzled Veteran
Join Date: Dec 2001
Location: Land of Enchantment
Status: Offline
Reply With Quote
Nov 20, 2010, 04:31 PM
 
That is goood
     
pwrmacg4  (op)
Forum Regular
Join Date: Jan 2005
Status: Offline
Reply With Quote
Nov 25, 2010, 06:56 PM
 
erased erased
     
pwrmacg4  (op)
Forum Regular
Join Date: Jan 2005
Status: Offline
Reply With Quote
Nov 25, 2010, 06:56 PM
 
This didn't work...Dont I need to create lproj.disabled directory first?

OUTPUT:
kits-mac-mini:~ kit$ sudo mv \
> /System/Library/Services/AppleSpell.service/Contents/Resources/en_GB.lproj\
> /System/Library/Services/AppleSpell.service/Contents/Resources/en_GB.lproj.disabled
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
( Last edited by pwrmacg4; Nov 25, 2010 at 07:18 PM. )
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 25, 2010, 11:19 PM
 
The backslashes (\) are what is causing the problem here, the feedback you are getting indicates a syntax error in your command.

The backslashes are just needed to allow a command to span multiple lines so that it doesn't have to wrap off of the edges of the screen. They are totally optional, just for visual purposes. SInce they are tripping you up I'd just take them out:

sudo mv /System/Library/Services/AppleSpell.service/Contents/Resources/en_GB.lproj /System/Library/Services/AppleSpell.service/Contents/Resources/en_GB.lproj.disabled


Just paste that into your terminal all into a single line. If you don't get anything in response after entering your password and after pressing return, it worked.
     
AKcrab
Moderator Emeritus
Join Date: Apr 2001
Location: Wasilla, Alaska
Status: Offline
Reply With Quote
Nov 26, 2010, 12:15 AM
 
I have no idea why he didn't just copy paste what I provided.
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Nov 26, 2010, 04:09 AM
 
It's because someone decided to make things more complicated than they needed to be by "correcting" it with the backslashes and all. It's a really bad idea when dealing with people who, unlike many in this forum, don't use the Terminal on a regular basis. KISS.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
pwrmacg4  (op)
Forum Regular
Join Date: Jan 2005
Status: Offline
Reply With Quote
Nov 27, 2010, 01:43 PM
 
I cut&pasted. It said "no such file or directory."
( Last edited by pwrmacg4; Nov 27, 2010 at 01:51 PM. )
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Nov 27, 2010, 02:48 PM
 
How about simplifying it a bit more by splitting it into two commands?

Code:
cd /System/Library/Services/AppleSpell.service/Contents/Resources sudo mv en_GB.lproj en_GB.lproj.disabled

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Rainy Day
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status: Offline
Reply With Quote
Dec 14, 2010, 05:10 PM
 
Originally Posted by pwrmacg4 View Post
This didn't work...Dont I need to create lproj.disabled directory first?

OUTPUT:
kits-mac-mini:~ kit$ sudo mv \
> /System/Library/Services/AppleSpell.service/Contents/Resources/en_GB.lproj\
> /System/Library/Services/AppleSpell.service/Contents/Resources/en_GB.lproj.disabled
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
That didn’t work because there’s no space between the source and target filenames, so the system sees only one, very looooong filename (where it expects to see two). The problem with using backslashes is it’s easy to mess up the whitespace. In this case, it’s missing a space before the second backslash. Another common problem is spaces between the backslash and the <cr>.

As Charles says, better to avoid backslashes unless you are experienced in the shell. However, it is often a good idea to start a long line with a backslash <cr>, as then the shell will wrap the line nicely in the terminal (something it doesn’t do if a long line occurs on the same line as the prompt).
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 03:45 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,