0

In .profile I have defined:

function fan.speed(){
    sudo su -c 'echo $@ > /sys/class/hwmon/hwmon1/pwm1'
}

It throws the error:

$ fan.speed 100
bash: "$@": ambiguous redirect

When I use "" instead of '', it works fine:

function fan.speed(){
    sudo su -c "echo $@ > /sys/class/hwmon/hwmon1/pwm1"
}

What's wrong with ''?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Alex Ander
  • 39
  • 5

0 Answers0