Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
How can I paste multiple line command with Docker interactive mode but not evaluating?

For example I am opening an interactive command line window.

docker exec -it container rails c

When I paste a multiple-line command, it evaluate every line instead of pasting a block. How can I configure it as not to evaluate?

Order.last
     .user
     .id
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Ah, simple trick here: type begin + enter, paste the code, type end:

begin
  Order.last
       .user
       .id
end

It cannot and should not be configurable. The reason is that the console cannot posisible know when you have finished typing the whole command, as the first line is a completely valid ruby statement. Things are slightly different if you adapt different coding style:

Order.last.
      user.
      id

The code above will work once copied to console (but gosh, I really hate that style!) because it is clear to the interpreter that the statement is not completed yet - similarly to missing closing bracket or quote. Wrapping the code in begin/end have the same effect - it tells the interpreter that the code is not yet completed, so it awaits for the final end.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!