Pipe command to script

view story

http://www.unix.com – Hello to all, Having a ruby script that works when an argument is given in command line in this way: Code: ruby script.rb input_to_ruby To accept arguments as input, inside the ruby script has Code: File.open(ARGV[0]) input_to_ruby is generated by another command, so I need to create first input_to_ruby in order to give as argument to script.rb, in this way. Code: ls -laD file1 > input_to_ruby How can I pipe the output of "ls" to avoid create first the input_to_ruby and do it directly? something like: Code: ls -laD file1 | script.rb Thanks in advan (HowTos)