Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Thank you, but please notice the description: There may be special characters in filenames as well as multiple file names. Your answer would only work for simple filenames. Commented Jul 24, 2020 at 12:02
  • You mean like this? Commented Jul 24, 2020 at 12:53
  • This is better, but still assumes file names do not contain newlines. As filenames may contain any character except the null byte, only null bytes would be a reliable delimiter in the temp file. Commented Jul 24, 2020 at 18:44
  • There are still some issues with this script, namely if you want to start-up vi without a filename. The "$1" = "" should probably be replaced by a test for the existence of the tmpfile-variable, and it should probably have a more complicated variable name. Commented Jul 25, 2020 at 10:54