in Education by
Specifically I have a PHP command-line script that at a certain point requires input from the user. I would like to be able to execute an external editor (such as vi), and wait for the editor to finish execution before resuming the script. My basic idea was to use a temporary file to do the editing in, and to retrieve the contents of the file afterwards. Something along the lines of: $filename = '/tmp/script_' . time() . '.tmp'; get_user_input ($filename); $input = file_get_contents ($filename); unlink ($filename); I suspect that this isn't possible from a PHP command-line script, however I'm hoping that there's some sort of shell scripting trick that can be employed to achieve the same effect. Suggestions for how this can be achieved in other scripting languages are also more than welcome. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You can redirect the editor's output to the terminal: system("vim > `tty`");

Related questions

0 votes
    Specifically I have a PHP command-line script that at a certain point requires input from the user. I ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 18, 2022 in Education by JackTerrance
0 votes
    Specifically I have a PHP command-line script that at a certain point requires input from the user. I ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I am trying to pass a dataString to to an ajax call using JQuery. In the call, I construct the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    how can i create a script in which i can search someone number and it will provide me name, country, email in an ... is used in this) Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    In C# when I am done entering the fields of a snippet, I can hit Enter to get to the next line. ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 20, 2022 in Education by JackTerrance
0 votes
    In C# when I am done entering the fields of a snippet, I can hit Enter to get to the next line. ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    What is the correct syntax for referring to an external script called “blogmepost.js”? A. B. C. D....
asked Feb 27, 2021 in Technology by JackTerrance
0 votes
    I would prefer to write my commit messages in Vim, but it is opening them in Emacs. How do I configure Git ... for a single project. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    The external JavaScript file must contain tag. True or False? A. True B. False...
asked Feb 27, 2021 in Technology by JackTerrance
0 votes
    I have a parameters.ini file, such as: [parameters.ini] database_user = user database_version = 20110611142248 I want to ... I do this? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I have an endless loop problem in Simpy simulation. My scenario is: After finishing triage, a patient wait ... ): admin_decision_prob = random.uniform(0, 1) if admin_decision_prob...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I have an XML file which is structured as follows: place1 location1 place2 location2 place3 location3 These ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    For how long afterwards can you use those articles? Select the correct answer from above options ... Science proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 7, 2021 in Education by JackTerrance
0 votes
    I'm trying to produce a page that would function a bit like a digital sticker album. My SQL ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 28, 2022 in Education by JackTerrance
...