0

I'm new in bash scripting world...

I'm trying to get value from pipe action to a var.

Something like:

result = $(ls /usr/bin | dmenu)

the idea is put files list into a standar menu (dmenu) so, when user select a choice, i want to know wich one is selected and work with this option to for example, execute a file.

the $result is not getting any value.

Thanks for your help

  • 1
    The other question doesn't make the exact same mistake, but the answer given (showing correct usage without excess whitespace) is on-point. – Charles Duffy Nov 10 '14 at 19:07

1 Answers1

1

Remove whitespaces before and after =:

result=$(ls /usr/bin | dmenu)
Cyrus
  • 84,225
  • 14
  • 89
  • 153