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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -