From 073ba53005ed163a4729c3639a9fb32e87fa7547 Mon Sep 17 00:00:00 2001 From: "Mr. Robot" Date: Sun, 16 May 2021 19:24:20 +0200 Subject: [PATCH] add file read and write to wget --- data/wget.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/data/wget.json b/data/wget.json index 7ea566a..36950c7 100644 --- a/data/wget.json +++ b/data/wget.json @@ -6,6 +6,18 @@ "code": "wget --post-file=[file] [url]\n" } ], + "file-read": [ + { + "description": "The file to be read is treated as a list of URLs, one per line, which are actually fetched by 'wget'. The content appears, somewhat modified, as error messages, thus this is not suitable to read arbitrary binary data.", + "code": "wget -i [file]\n" + } + ], + "file-write": [ + { + "description": "The data to be written is treated as a list of URLs, one per line, which are actually fetched by 'wget'. The data is written, somewhat modified, as error messages, thus this is not suitable to write arbitrary binary data.", + "code": "TF=$(mktemp)\necho [data] > $TF\nwget -i $TF -o [file]\n" + } + ], "file-download": [ { "description": "Fetch a remote file via HTTP GET request.", @@ -25,4 +37,4 @@ } ] } -} \ No newline at end of file +}