kill: failed to parse argument %n

New to Debian (Or Linux in general)? Ask your questions here!

kill: failed to parse argument %n

Postby alete » 2018-05-29 15:37

Hello, everybody.
I'm running a clean Debian 9 on my laptop and I'm being unable to kill a proccess giving it's job number:

Code: Select all
alete@debian:~$ vi &
[1] 14760
alete@debian:~$ jobs
[1]+  Stopped                 vi
alete@debian:~$ sudo kill %1
kill: failed to parse argument: '%1'
alete@debian:~$


wasn't it supposed to work this way?
alete
 
Posts: 17
Joined: 2017-05-19 16:42

Re: kill: failed to parse argument %n

Postby debiman » 2018-05-31 17:47

you're supposed to use the pid.
also see
Code: Select all
man kill
User avatar
debiman
 
Posts: 2405
Joined: 2013-03-12 07:18

Re: kill: failed to parse argument %n

Postby alete » 2018-06-01 12:11

debiman wrote:you're supposed to use the pid.
also see
Code: Select all
man kill


%1 indicates a job, it should return the pid https://superuser.com/a/317155/627973
alete
 
Posts: 17
Joined: 2017-05-19 16:42

Re: kill: failed to parse argument %n

Postby kingocounty » 2018-06-01 12:35

Bash has a built-in kill function that takes precedence over the external kill command, and it does support jobspecs.

Typing
Code: Select all
help kill
will show you the details.

Try your command again without 'sudo'.
User avatar
kingocounty
 
Posts: 5
Joined: 2018-03-14 13:11

Re: kill: failed to parse argument %n

Postby debiman » 2018-06-02 11:33

kingocounty wrote:Try your command again without 'sudo'.

i remembered this a second after i pressed reply, but was too lazy to go back and edit...
User avatar
debiman
 
Posts: 2405
Joined: 2013-03-12 07:18


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable