gabriel80546 my script is not working 18:31
script ->
#!/usr/bin/env perl6
my $key = run 'xmodmap', '-e', '"keycode 66 = Shift_L Shift_R"', :out;
say "saida: -> ", $key.out.get;
output ->
xmodmap: unknown command on line commandline:1 18:32
xmodmap: 1 error encountered, aborting.
saida: -> Nil
im sorry for posting that 18:33
but i think the documentation didn't help me 18:34
xmodmap is a command that exists 18:36
gabriel@adriano:~$ which xmodmap
'''/usr/bin/xmodmap
my bad also the out of xmodmap is empty anyways 18:38
i will try shell or spawn 18:45
[Coke] ... you're running xmodmap, or the error wouldn't be coming. 18:46
so what's the issue? 18:47
m: run 'notacommand';
camelia The spawned command 'notacommand' exited unsuccessfully (exit code: 1, signal: 0)
in block <unit> at <tmp> line 1
gabriel80546 shell works 18:48
script -> 18:49
#!/usr/bin/env perl6
my $key = shell ("xmodmap -e 'keycode 66 = Shift_L Shift_R'");
say "\$key", $key
output ->
$keyProc.new(in => IO::Pipe, out => IO::Pipe, err => IO::Pipe, exitcode => 0, signal => 0, pid => 4511, command => ("xmodmap -e 'keycode 66 = Shift_L Shift_R'",))
[Coke] 18:50
i run what you said
> run 'notacommand'
Proc.new(in => IO::Pipe, out => IO::Pipe, err => IO::Pipe, exitcode => 1, signal => 0, pid => Nil, command => ("notacommand",))
> 18:51
[Coke] if you try to do anything with that result, you'll get the error shown above. even "sink run 'notacommand'" will trigger it 18:52
you can see the exitcode is 1, though.
In the one that worked, you had single quotes around the arg to xmodmap. in the one that didn't, you had double quotes.
You probably don't even need the quotes in the first one, because you're using run. the args are already split up in the arguments to run, you don't need to protect them. 18:53
gabriel80546 i am curious how it would work with run 18:54
now it works 18:55
you are absolutly right 18:56
script ->
#!/usr/bin/env perl6
my $key = run "xmodmap", "-e", "keycode 66 = Shift_L Shift_R", :out;
say "\$key ", $key.out.get;
output ->
$key Nil
that is the output that i expected
thank you very much 18:57
[Coke] sure! 19:28