Bash command in ruby script - Error "Command not found" -
i need run bash command (ls -al) in ruby script. command launched in different folders start letters "my".
dir.glob("#{path_to_search}/my*",file::fnm_casefold) |path| command = path + "/ls -al" output_result = (%x(#{command})) end
i receive strange error:
"command not found: /home/user/my123/ls -al" "command not found: /home/user/my222/ls -al" "command not found: /home/user/my423/ls -al"
the iteration goes well. problem command
you generate commands inproperly. should be:
command = 'ls -al ' + path
Comments
Post a Comment