Possible? Issue a command w/output opened by text editor without writing a file?
[text editor command] [find . -iname "*apricot*" (instead of filename)]
pipes and redirects? |
Some editors accept data via stdin. Supposedly nano does too, but here are two examples for vim:
Code:
find . -iname "*apricot*" | vim - The second example above relies on a Bashism, but may also work in a few other shells such as Zsh. |
Quote:
This distro has geany, leafpad, vi where none open the data. |
actually it is not possible. in the background a file will be created anyway and will be opened by the editor. Just you will not able to identify it. By the way editing stdin is pointless. If you just want to see the content (result of that command) don't use an editor, but a pager, like: less, more, cat (or similar).
Code:
find ..... | less |
I don't quite understand what you're up to. The subject of your thread doesn't match its contents.
In simple cases, sed will definitely do: Code:
find -iname '*apricot*' -exec sed 'editing commands' {} + Code:
find -iname '*apricot*' -exec geany {} + Code:
command1 | sed 'editing commands' | command2 |
I simply wanted to redirect or pipe the output of the find command to a text editor, unsaved.
Code:
find [parameters] | leafpad Code:
cat [textfile] | leafpad Code:
openssl [decryption parameters deciphered to screen (no specific output file)] | leafpad The -exec switch tends to open a single file even if multiple matching files are in the directory. Quote:
|
Quote:
Code:
$ cat lvg.txt Code:
openssl base64 -in lvg.txt|openssl base64 -d|leafpad Code:
$ cat password |
Quote:
It's easy to make OpenSSL output to screen, just exclude the -out file and stdio is chosen. But sending that to leafpad for me will require more tinkering. Your second line looks good if it'll work. |
Quote:
Code:
a="This is line one |
Looks good but is there ever a file name "temp" sitting in the working directory?
Avoiding file output is the first goal. Quote:
|
There has to be a file somewhere. Even when piped 'directly' into an editor, the stream will be saved temporarly by the editor. However, if you make your own temporary file, you can bury it in a temporary directory and then erase both when done:
Code:
#/bin/sh |
Quote:
I'm still struggling with pipe parameters, because some scenarios it seems to work and others it won't. |
As an afterthought, another layer to add might be to make a tiny, temporary RAM disk of some kind and keep the temporary file there. The RAM disk can then be removed when the editing has been completed.
|
All times are GMT -5. The time now is 08:11 PM. |