From: Paul Mena Date: 2012-12-15T04:35:35+09:00 Subject: Re: Invoking bash from Ruby Thanks for the quick reply! I've substituted $1 with ARGV[0], as I believe that's proper Ruby syntax for a command argument, but I'm still having trouble getting the grep command to treat the argument as a file name. Here's the entirety of my code: #!/usr/bin/env ruby fn = ARGV[0] puts fn date = %x{grep "Date:" fn | cut -d' ' -f3-5} puts date And here's the result when I run it on the command line: pablo@pmenaws1=> ./extract_date_written.rb myfile.html myfile.html grep: fn: No such file or directory I'm hoping this is a newbie mistake that is easily remedied. Thanks again in advance. -- Posted via http://www.ruby-forum.com/.