From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19487 invoked by alias); 20 Apr 2016 01:17:52 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21455 Received: (qmail 19585 invoked from network); 20 Apr 2016 01:17:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.1 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: zsh-users@zsh.org To: zsh-users@zsh.org From: Emanuel Berg Subject: virtual files? Date: Wed, 20 Apr 2016 01:00:09 +0000 Message-ID: <8760vdrt5y.fsf@student.uu.se> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:Q/JVe115bLIs/HgJZjBUGDlbRUA= Here is a program I just wrote. Feel free to comment on any part. However my specific question is, instead of using the "result_file" stuff, is there support for I suppose "virtual files" or basically a data structure that can be used transparently as a file, or with but small adjustments? TIA. #! /bin/zsh # This file: http://user.it.uu.se/~embe8573/conf/.zsh/money # zsh CLI to Internet inflation calculator. # # Try, for example, three K2 expeditions: # # $ inflation 9000 1938; inflation 30958.33 1953; inflation 108000 1954 # # which yields: # # $151,999.15 # $276,111.20 # $956,069.00 inflation () { local usd=${1:-10} # year local then=${2:-1950} local now=`date +"%Y"` local result_file=result local link="http://data.bls.gov/cgi-bin/cpicalc.pl?cost1=$usd&year1=$then&year2=$now" wget -q $link -O $result_file echo -n \$ grep \"answer\" $result_file | cut -d \$ -f 2 | cut -d \< -f 1 rm $result_file } -- underground experts united .... http://user.it.uu.se/~embe8573 Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic - so far: 25 Blogomatic articles -