Page MenuHomePhabricator

mwscript-k8s fails when there are parenthesis used in arguments
Closed, InvalidPublic

Description

When I tried to execute a command to change permissions for a WMF user, code failed with

-bash: syntax error near unexpected token `(

I think that token ( came from my wiki username - PMiazga_(WMF).

How to replicate error:

pmiazga@deploy2002:~$ echo "(test)"
(test)
pmiazga@deploy2002:~$ mwscript-k8s --comment="T378402" -- CentralAuth:addToGlobalGroup.php --wiki metawiki —user “PMiazga_(WMF)” —group “oathauth-tester” —reason “T378402 - Testing 2FA”
-bash: syntax error near unexpected token `('

Event Timeline

@pmiazga you have weird quotes in your command line:

$ echo “PMiazga_(WMF)”
-bash: syntax error near unexpected token `('
$ echo "PMiazga_(WMF)"
PMiazga_(WMF)

I don't know how you ended up with a character in your shell prompt but this works

deploy2002:~$ mwscript-k8s --comment='T378402' -- CentralAuth:addToGlobalGroup.php --wiki metawiki —user 'PMiazga_(WMF)' —group 'oathauth-tester' —reason 'T378402 - Testing 2FA'
⏳ Starting CentralAuth:addToGlobalGroup.php on Kubernetes as job mw-script.codfw.mj8katcn ...

(Also --user somehow became —user with an em dash, probably at the same time.)

Sorry, those have to probably copy and paste quirks on macos :/. Quite often I use an editor to prepare the entire command and then paste it.

You're correct - something changed the double quotes and I missed that. I should be using C-xC-e instead.

Sorry to bother you, let me close this as invalid.