Capture user input by opening a text editor with content
问题 From a bash script, I'd like to Open the default text editor for current user Paste a string $original_content in it Once the user modifies the content then closes the text editor, Capture the modified string into a variable $modified_content Then save $modified_content to an $output_file Google searches for capturing user input shows read which is not what I'm looking for. Can someone point me to the right direction? Thank you 回答1: This method should hopefully work for most editors: #!/bin