Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!hal!ncoast!allbery From: allbery@ncoast.UUCP Newsgroups: comp.unix.wizards Subject: Re: /dev/stdin: why not call it "-"? Message-ID: <2683@ncoast.UUCP> Date: Sat, 20-Jun-87 16:18:49 EDT Article-I.D.: ncoast.2683 Posted: Sat Jun 20 16:18:49 1987 Date-Received: Sun, 21-Jun-87 12:06:27 EDT References: <7359@brl-adm.ARPA> <5856@brl-smoke.ARPA> <15318@onfcanim.UUCP> <1098@hropus.UUCP> <414@murphy.UUCP> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.unix.wizards Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 28 As quoted from <414@murphy.UUCP> by dave@murphy.UUCP (Snipe Hunter): +--------------- | In article <1098@hropus.UUCP>, ka@hropus.UUCP writes: | > "-" is certainly easier to type than "/dev/stdin" and is already somewhat | > of a UN*X convention. | [code deleted] | | Why not just make the shell recognize "-" by itself as a special argument and | have it substitute "/dev/stdin"? The only problem that this would cause that | I can think of is that you'd have to quote it to use it as the subtraction | operator to expr, for instance. +--------------- But what about "tar cvf - dir | compress > dir.tar.Z"? In this case you would want "-" to refer to /dev/stdout, no? And how is the shell to know THAT? (At least the mod to open() can check to see if the mode is O_RDONLY or O_WRONLY and use /dev/stdin or /dev/stdout based on the results -- not that I advocate that implementation.) ++Brandon -- Copyright (C) 1987 Brandon S. Allbery. Redistribution permitted only if the redistributor permits further redistribution. (Stargate take heed!) ---- Moderator for comp.sources.misc and comp.binaries.ibm.pc ---- Brandon S. Allbery {decvax,cbosgd}!cwruecmp!ncoast!allbery aXcess Company {ames,mit-eddie,talcott}!necntc!ncoast!allbery 6615 Center St. #A1-105 necntc!ncoast!allbery@harvard.HARVARD.EDU Mentor, OH 44060-4101 +01 216 974 9210 (also eddie.MIT.EDU)