instance variable into call linux command

L

Luiz Macchi

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
 
A

Arlen Cuss

[Note: parts of this message were removed to make it a legal post.]

Hi.
ls: joe: No such file or directory
=> ""
Use the string interpolation #{ruby code here}.

Arlen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top