From: "Bartosz DziewoƄski" Date: 2012-12-15T04:52:00+09:00 Subject: Re: Invoking bash from Ruby Yes; use string interpolation to insert the variable's content into the string: foo = 'world' puts "Hello, #{foo}!" # outputs: Hello, world! It works the same for backticks and the percent string-like notation (but you'll have to use %X with uppercased X, similarly to how you have to use strings in quotes instead of in apostrophes to be able to interpolate in them). So this would be (note: code untested): date = %X{grep "Date:" #{fn} | cut -d' ' -f3-5} Also, if the contents of fn come from the user, you should escape it somehow to prevent them from executing arbitrary commands in your shell environment! -- Matma Rex