From 453802d183c572ee8e28d38e134e59ff0e2a9f39 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Tue, 19 Feb 2013 13:26:58 +0100 Subject: [PATCH] blink: multiple devices work. --- blink/blink | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/blink/blink b/blink/blink index d1e43c6..3eda0ac 100755 --- a/blink/blink +++ b/blink/blink @@ -206,21 +206,21 @@ if($::opt_on) { sub on { my $locate = shift; - print("parallel -j1 echo 1 \\> ::: $locate\n"); - system("parallel -j1 echo 1 \\> ::: $locate\n"); + print(q{bash -c 'parallel -j1 echo 1 \\> {} ::: }. $locate."'\n"); + system(q{bash -c 'parallel -j1 echo 1 \\> {} ::: }. $locate."'\n"); } sub off { my $locate = shift; - print("parallel -j1 echo 0 \\> ::: $locate\n"); - system("parallel -j1 echo 0 \\> ::: $locate\n"); + print(q{bash -c 'parallel -j1 echo 0 \\> {} ::: }. $locate."'\n"); + system(q{bash -c 'parallel -j1 echo 0 \\> {} ::: }. $locate."'\n"); } sub toggle { my $locate = shift; # If the file 'locate' contains 1 it should be put to 0. - print('parallel -j1 grep -q 1 {} \; echo \$? \\> {} :::'." $locate\n"); - system('parallel -j1 grep -q 1 {} \; echo \$? \\> {} :::'." $locate\n"); + print(q{bash -c 'parallel -j1 grep -q 1 {} \; echo \$? \\> {} ::: }. $locate."'\n"); + system(q{bash -c 'parallel -j1 grep -q 1 {} \; echo \$? \\> {} ::: }. $locate."'\n"); }