Instance variable into call linux command

Hi all,
I need to call a Linux command from ruby app to print a text file ! so
i´d like to put a instance variable (@printer_name) into the command
!

for example:

def imprimir
lpr -P@printer_name /tmp/impressao.txt
end

how to do this ? it dont recognize the variable…

if i put the name of printer instead it runs

thanks any help

Hi.

@a = “joe”
=> “joe”

ls #{@a}
ls: joe: No such file or directory
=> “”

Use the string interpolation #{ruby code here}.

Arlen