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
  • 107,083
  • 22
  • 201
  • 376
Alex Ander
  • 39
  • 5

0 Answers0