Diffs to the Frequently Asked Questions postings
Steve Hayman
sahayman at iuvax.cs.indiana.edu
Thu Jan 4 07:30:57 AEST 1990
Here are the most recent changes to parts 1 and 2 of the
Frequently Asked Questions articles, which have just been
posted. You can find the full articles elsewhere in
comp.unix.questions and comp.unix.wizards.
*** /tmp/,RCSt1a13729 Wed Jan 3 15:27:42 1990
--- part2 Wed Jan 3 15:27:30 1990
***************
*** 1,6 ****
Subject: Frequently Asked Questions about Unix - with Answers [Monthly posting]
! [Last changed: $Date: 89/12/01 14:50:10 $ by $Author: sahayman $]
This article contains the answers to some Frequently Asked Questions
often seen in comp.unix.questions and comp.unix.wizards. Please don't
--- 1,6 ----
Subject: Frequently Asked Questions about Unix - with Answers [Monthly posting]
! [Last changed: $Date: 90/01/03 15:27:26 $ by $Author: sahayman $]
This article contains the answers to some Frequently Asked Questions
often seen in comp.unix.questions and comp.unix.wizards. Please don't
***************
*** 11,42 ****
This article includes answers to:
! How do I remove a file whose name begins with a "-" ?
! How do I remove a file with funny characters in the filename ?
! How do I get a recursive directory listing?
! How do I get the current directory into my prompt?
! How do I read characters from a terminal without requiring the user
! to hit RETURN?
! How do I read characters from the terminal in a shell script?
! How do I check to see if there are characters to be read without
! actually reading?
! How do I find the name of an open file?
! How do I rename "*.foo" to "*.bar", or change file names to lowercase?
! Why do I get [some strange error message] when I "rsh host command" ?
! How do I find out the creation time of a file?
! How do I use "rsh" without having the rsh hang around
! until the remote command has completed?
! How do I truncate a file?
! How do I {set an environment variable, change directory} inside a
! shell script and have that change affect my current shell?
! Why doesn't find's "{}" symbol do what I want?
! How do I redirect stdout and stderr separately in csh?
! How do I set the permissions on a symbolic link?
! What does {awk,grep,fgrep,egrep,biff,cat,gecos,nroff,troff,tee,bss}
! stand for?
! How do I pronounce "vi" , or "!", or "/*", or ...?
While these are all legitimate questions, they seem to crop up in
comp.unix.questions on an annual basis, usually followed by plenty
--- 11,48 ----
This article includes answers to:
! 1) How do I remove a file whose name begins with a "-" ?
! 2) How do I remove a file with funny characters in the filename ?
! 3) How do I get a recursive directory listing?
! 4) How do I get the current directory into my prompt?
! 5) How do I read characters from a terminal without requiring the user
! to hit RETURN?
! 6) How do I read characters from the terminal in a shell script?
! 7) How do I check to see if there are characters to be read without
! actually reading?
! 8) How do I find the name of an open file?
! 9) How do I rename "*.foo" to "*.bar", or change file names
! to lowercase?
! 10) Why do I get [some strange error message] when I
! "rsh host command" ?
! 11) How do I find out the creation time of a file?
! 12) How do I use "rsh" without having the rsh hang around
! until the remote command has completed?
! 13) How do I truncate a file?
! 14) How do I {set an environment variable, change directory} inside a
! shell script and have that change affect my current shell?
! 15) Why doesn't find's "{}" symbol do what I want?
! 16) How do I redirect stdout and stderr separately in csh?
! 17) How do I set the permissions on a symbolic link?
! 18) When someone refers to 'rn(1)' or 'ctime(3)', what does
! the number in parentheses mean?
! 19) What does {awk,grep,fgrep,egrep,biff,cat,gecos,nroff,troff,tee,bss}
! stand for?
! 20) How do I pronounce "vi" , or "!", or "/*", or ...?
+ If you're looking for the answer to, say, question 14, and want to skip
+ everything else, you can search ahead for the regular expression "^14)".
While these are all legitimate questions, they seem to crop up in
comp.unix.questions on an annual basis, usually followed by plenty
***************
*** 231,237 ****
--- 237,250 ----
exit(0);
}
+ You might like to check out the documentation for the "curses"
+ library of portable screen functions. Often if you're interested
+ in single-character I/O like this, you're also interested in doing
+ some sort of screen display control, and the curses library
+ provides various portable routines for both functions.
+
+
6) How do I read characters from the terminal in a shell script?
In sh, use read. It is most common to use a loop like
***************
*** 366,376 ****
C Shell:
foreach f ( * )
! mv $f `echo $f | tr A-Z a-z`
end
Bourne Shell:
for f in *; do
! mv $f `echo $f | tr A-Z a-z`
done
If you wanted to be really thorough and handle files with
--- 379,389 ----
C Shell:
foreach f ( * )
! mv $f `echo $f | tr '[A-Z]' '[a-z]'`
end
Bourne Shell:
for f in *; do
! mv $f `echo $f | tr '[A-Z]' '[a-z]'`
done
If you wanted to be really thorough and handle files with
***************
*** 379,387 ****
Bourne Shell:
for f in *; do
! eval mv '"$i"' \"`echo "$i" | tr '[A-Z]' '[a-z]'`\"
done
If you have the "perl" language installed, you may find this rename
script by Larry Wall very useful. It can be used to accomplish a
wide variety of filename changes.
--- 392,405 ----
Bourne Shell:
for f in *; do
! eval mv '"$f"' \"`echo "$f" | tr '[A-Z]' '[a-z]'`\"
done
+ (Some versions of "tr" require the [ and ], some don't. It happens
+ to be harmless to include them in this particular example; versions of
+ tr that don't want the [] will conveniently think they are supposed
+ to translate '[' to '[' and ']' to ']').
+
If you have the "perl" language installed, you may find this rename
script by Larry Wall very useful. It can be used to accomplish a
wide variety of filename changes.
***************
*** 563,568 ****
--- 581,593 ----
You could then use
find /path -type d -exec ./doit {} \;
+
+ Or if you want to avoid the "./doit" shell script, you can use
+
+ find /path -type d -exec sh -c 'command $0/*' {} \;
+
+ (This works because within the 'command' of "sh -c 'command' A B C ...",
+ $0 expands to A, $1 to B, and so on.)
If all you're trying to do is cut down on the number of times
***************
*** 604,611 ****
only permissions that count are the permissions on the file that
the link points to.
! 18) What does {awk,grep,fgrep,egrep,biff,cat,gecos,nroff,troff,tee,bss}
stand for?
awk = "Aho Weinberger and Kernighan"
--- 629,672 ----
only permissions that count are the permissions on the file that
the link points to.
+ 18) When someone refers to 'rn(1)' or 'ctime(3)', what does
+ the number in parentheses mean?
! It looks like some sort of function call, but it isn't.
! These numbers refer to the section of the "Unix manual" where
! the appropriate documentation can be found. You could type
! "man 3 ctime" to look up the manual page for "ctime" in section 3
! of the manual.
!
! The standard manual sections are:
!
! 1 User-level commands
! 2 System calls
! 3 Library functions
! 4 Devices and device drivers
! 5 File formats
! 6 Games
! 7 Various miscellaneous stuff - macro packages etc.
! 8 System maintenance and operation commands
!
!
! Each section has an introduction, which you can read with "man # intro"
! where # is the section number.
!
! Sometimes the number is necessary to differentiate between a
! command and a library routine or system call of the same name. For
! instance, your system may have "time(1)", a manual page about the
! 'time' command for timing programs, and also "time(3)", a manual
! page about the 'time' subroutine for determining the current time.
! You can use "man 1 time" or "man 3 time" to specify which "time"
! man page you're interested in.
!
! You'll often find other sections for local programs or
! even subsections of the sections above - Ultrix has
! sections 3m, 3n, 3x and 3yp among others.
!
!
! 19) What does {awk,grep,fgrep,egrep,biff,cat,gecos,nroff,troff,tee,bss}
stand for?
awk = "Aho Weinberger and Kernighan"
***************
*** 705,711 ****
Don Libes' book "Life with Unix" contains lots more of these
tidbits.
! 19) How do I pronounce "vi" , or "!", or "/*", or ...?
You can start a very long and pointless discussion by wondering
about this topic on the net. Some people say "vye", some say
--- 766,772 ----
Don Libes' book "Life with Unix" contains lots more of these
tidbits.
! 20) How do I pronounce "vi" , or "!", or "/*", or ...?
You can start a very long and pointless discussion by wondering
about this topic on the net. Some people say "vye", some say
***************
*** 719,862 ****
dialects and accents.
Since this topic keeps coming up on the net, here is a comprehensive
! pronunciation list that has made the rounds in the past.
! Origin unknown - please let me know if you know where it came from,
! and I'll attribute it properly.
Names derived from UNIX are marked with *, names derived from C are marked
! with +, and names deserving futher explanation are marked with a #. The
! explanations will be given at the very end.
------------------------------------------------------------------------------
-- SINGLE CHARACTERS --
! SPACE, blank
! ! EXCLAMATION POINT, exclamation mark, exclamation, exclam, excl, clam,
bang#, shout, yell, shriek, pling, factorial, ball-bat, smash, cuss,
! wow, hey, boing
! " QUOTATION MARK, quote, double quote, dirk, literal mark, rabbit ears,
! double ping, double glitch
# CROSSHATCH, pound, pound sign, number, number sign, sharp, octothorpe#,
hash, fence, crunch, mesh, hex, flash, grid, pig-pen, tictactoe,
! scratch, scratch mark, gardengate, gate, hak, oof, rake, sink
$ DOLLAR SIGN, dollar, cash, currency symbol, buck, string#, escape#,
! ding, big-money
! % PERCENT SIGN, percent, mod+, shift-5, double-oh-seven, grapes
& AMPERSAND, and, amper, address+, shift-7, andpersand, snowman,
! bitand+, donald duck#, daemon
! ' APOSTROPHE, single quote, quote, tick, prime, irk, pop, spark, glitch
* ASTERISK, star, splat, spider, aster, times, wildcard*, gear, dingle,
! (Nathan) Hale#, bug, gem, twinkle
! () PARENTHESES, parens, round brackets, bananas, ears, bowlegs,
! parenthesee (singular only), weapons
! ( LEFT PARENTHESIS, paren, so, wax, parenthesee, open, sad
! ) RIGHT PARENTHESIS, thesis, already, wane, unparenthesee, close, happy
!
! + PLUS SIGN, plus, add, cross, and, intersection, and
!
! , COMMA, tail
!
! - HYPHEN, minus, minus sign, dash, dak, option, flag, negative,
! negative sign, worm, bithorpe#
! . PERIOD, dot, decimal, decimal point, radix point, point, spot, full stop,
! put#, floor
/ SLASH, stroke, virgule, solidus, slant, diagonal, over, slat, slak,
! across#, compress#, spare
! : COLON, two-spot, double dot, dots
! ; SEMICOLON, semi, hybrid
! <> ANGLE BRACKETS, angles, funnels, brokets
< LESS THAN, less, read from*, from*, in*, comesfrom*, crunch,
! sucks
> GREATER THAN, more, write to*, into/toward*, out*, gazinta*, zap,
! blows
! = EQUAL SIGN, equals, equal, gets, quadrathorpe#, half-mesh
? QUESTION MARK, question, query, whatmark, what, wildchar*, huh, ques,
! kwes, quiz, quark, hook
!
! @ AT SIGN, at, each, vortex, whorl, whirlpool, cyclone, snail, ape, cat,
! snable-a#, trunk-a#, rose, cabbage, Mercantile symbol
! [] BRACKETS, square brackets, U-turns, edged parentheses, mimics
! [ LEFT BRACKET, bracket, bra, square, opensquare
! ] RIGHT BRACKET, unbracket, ket, unsquare, close
!
! \ BACKSLASH, reversed virgule, bash, backslant, backwhack, backslat,
! escape*, backslak, bak, reduce#
!
! ^ CIRCUMFLEX, caret, carrot, hat, cap, uphat, party hat, housetop,
! up arrow, control, boink, chevron, hiccup, to-the, fang, sharkfin,
! and#, xor+, wok, trap
! _ UNDERSCORE, underline, underbar, under, score, backarrow, flatworm, blank
! ` GRAVE, grave accent, accent, backquote, left/open quote, backprime,
unapostrophe, backspark, birk, blugle, backtick, push, backglitch,
! backping
{} BRACES, curly braces, squiggly braces, curly brackets, squiggle brackets,
! Tuborgs#, ponds
! { LEFT BRACE, brace, curly, leftit, embrace, openbrace, begin+
! } RIGHT BRACE, unbrace, uncurly, rytit, bracelet, close, end+
| VERTICAL BAR, pipe*, pipe to*, vertical line, broken line#, bar, or+,
bitor+, vert, v-bar, spike, to*, gazinta*, thru*, pipesinta*, tube,
! mark, whack, gutter, wall
~ TILDE, twiddle, tilda, tildee, wave, squiggle, swung dash, approx,
! wiggle, enyay#, home*, worm
-- MULTIPLE CHARACTER STRINGS --
!? interrobang (one overlapped character)
! /* slashterix+
! */ asterslash+
! >> appends*, cat-astrophe
-> arrow+, pointer to+, hiccup+
#! sh'bang, wallop
\!* bash-bang-splat
() nil#
! && and+, amper-amper, succeeds-then*
! || or+, fails-then*
-- NOTES --
! bang comes from old card punch phenom where punching ! code made a
! loud noise
# octothorpe from Bell System
$ string from BASIC
$ escape from TOPS-10
& donald duck from the Danish "Anders And", which means "Donald Duck"
* splat from DEC "spider" glyph
* Nathan Hale "I have but one asterisk for my country."
= quadrathorpe half an octothorpe
- bithorpe half a quadrathorpe (So what's a monothorpe?)
. put Victor Borge on Electric Company
/ across APL
/ compress APL
@ snable-a from Danish; may translate as "trunk-a"
@ trunk-a "trunk" = "elephant nose"
! ^ and from formal logic
\ reduce APL
{} Tuborgs from advertizing for well-known Danish beverage
| broken line EBCDIC has two vertical bars, one solid and one broken.
~ enyay from the Spanish n-tilde
() nil LISP
--- 780,961 ----
dialects and accents.
Since this topic keeps coming up on the net, here is a comprehensive
! pronunciation list that has made the rounds in the past. This list
! is maintained by Maarten Litmaath, maart at cs.vu.nl .
Names derived from UNIX are marked with *, names derived from C are marked
! with +, names derived from (Net)Hack are marked with & and names deserving
! futher explanation are marked with a #. The explanations will be given at
! the very end.
------------------------------------------------------------------------------
-- SINGLE CHARACTERS --
! SPACE, blank, ghost&
! ! EXCLAMATION POINT, exclamation (mark), (ex)clam, excl, wow, hey, boing,
bang#, shout, yell, shriek, pling, factorial, ball-bat, smash, cuss,
! store#, potion&, not*+
! " QUOTATION MARK, (double) quote, dirk, literal mark, rabbit ears,
! double ping, double glitch, amulet&, web&
# CROSSHATCH, pound, pound sign, number, number sign, sharp, octothorpe#,
hash, fence, crunch, mesh, hex, flash, grid, pig-pen, tictactoe,
! scratch (mark), (garden)gate, hak, oof, rake, sink&, corridor&,
! unequal#
$ DOLLAR SIGN, dollar, cash, currency symbol, buck, string#, escape#,
! ding, big-money, gold&
! % PERCENT SIGN, percent, mod+, shift-5, double-oh-seven, grapes, food&
& AMPERSAND, and, amper, address+, shift-7, andpersand, snowman,
! bitand+, donald duck#, daemon&, background*
! ' APOSTROPHE, (single) quote, tick, prime, irk, pop, spark, glitch,
! lurker above&
* ASTERISK, star, splat, spider, aster, times, wildcard*, gear, dingle,
! (Nathan) Hale#, bug, gem&, twinkle, funny button#, pine cone, glob*
! () PARENTHESES, parens, round brackets, bananas, ears, bowlegs
! ( LEFT PARENTHESIS, (open) paren, so, wane, parenthesee, open, sad,
! tool&
! ) RIGHT PARENTHESIS, already, wax, unparenthesee, close (paren), happy,
! thesis, weapon&
!
! + PLUS SIGN, plus, add, cross, and, intersection, door&, spellbook&
!
! , COMMA, tail, trapper&
!
! - HYPHEN, minus (sign), dash, dak, option, flag, negative (sign), worm,
! bithorpe#
! . PERIOD, dot, decimal (point), (radix) point, spot, full stop,
! put#, floor&
/ SLASH, stroke, virgule, solidus, slant, diagonal, over, slat, slak,
! across#, compress#, spare, divided-by, wand&
! : COLON, two-spot, double dot, dots, chameleon&
! ; SEMICOLON, semi, hybrid, giant eel&, go-on#
! <> ANGLE BRACKETS, angles, funnels, brokets, pointy brackets
< LESS THAN, less, read from*, from*, in*, comesfrom*, crunch,
! sucks, left chevron#, open pointy (brack[et]), bra#, upstairs&
> GREATER THAN, more, write to*, into/toward*, out*, gazinta*, zap,
! blows, right chevron#, closing pointy (brack[et]), ket#, downstairs&
! = EQUAL SIGN, equal(s), gets, becomes, quadrathorpe#, half-mesh, ring&
? QUESTION MARK, question, query, whatmark, what, wildchar*, huh, ques,
! kwes, quiz, quark, hook, scroll&
! @ AT SIGN, at, each, vortex, whirl, whirlpool, cyclone, snail, ape, cat,
! snable-a#, trunk-a#, rose, cabbage, Mercantile symbol, strudel#,
! fetch#, shopkeeper&, human&
!
! [] BRACKETS, square brackets, U-turns, edged parentheses
! [ LEFT BRACKET, bracket, bra, (left) square (brack[et]), opensquare,
! armor&
! ] RIGHT BRACKET, unbracket, ket, right square (brack[et]), unsquare, close,
! mimic&
!
! \ BACKSLASH, reversed virgule, bash, (back)slant, backwhack, backslat,
! escape*, backslak, bak, reduce#, opulent throne&
!
! ^ CIRCUMFLEX, caret, carrot, (top)hat, cap, uphat, party hat, housetop,
! up arrow, control, boink, chevron, hiccup, power, to-the(-power), fang,
! sharkfin, and#, xor+, wok, trap&, pointer#, pipe*
! _ UNDERSCORE, underline, underbar, under, score, backarrow, flatworm, blank,
! chain&, gets#
! ` GRAVE, (grave) accent, backquote, left/open quote, backprime,
unapostrophe, backspark, birk, blugle, backtick, push, backglitch,
! backping, execute#, boulder&, rock&
{} BRACES, curly braces, squiggly braces, curly brackets, squiggle brackets,
! Tuborgs#, ponds, curly chevrons#, squirrly braces, hitchcocks#
! { LEFT BRACE, brace, curly, leftit, embrace, openbrace, begin+,
! fountain&
! } RIGHT BRACE, unbrace, uncurly, rytit, bracelet, close, end+, a pool&
| VERTICAL BAR, pipe*, pipe to*, vertical line, broken line#, bar, or+,
bitor+, vert, v-bar, spike, to*, gazinta*, thru*, pipesinta*, tube,
! mark, whack, gutter, wall&
~ TILDE, twiddle, tilda, tildee, wave, squiggle, swung dash, approx,
! wiggle, enyay#, home*, worm, not+
-- MULTIPLE CHARACTER STRINGS --
!? interrobang (one overlapped character)
! */ asterslash+, times-div#
! /* slashterix+, slashaster
! := becomes#
! <- gets
! << left-shift+, double smaller
! <> unequal#
! >> appends*, cat-astrophe, right-shift+, double greater
-> arrow+, pointer to+, hiccup+
#! sh'bang, wallop
\!* bash-bang-splat
() nil#
! && and+, and-and+, amper-amper, succeeds-then*
! || or+, or-or+, fails-then*
-- NOTES --
! bang comes from old card punch phenom where punching ! code made a
! loud noise; however, this pronunciation is used in the (non-
! computerized) publishing and typesetting industry in the U.S.
! too, so ...
! ! store from FORTH
# octothorpe from Bell System
+ # unequal e.g. Modula-2
$ string from BASIC
$ escape from TOPS-10
& donald duck from the Danish "Anders And", which means "Donald Duck"
* splat from DEC "spider" glyph
* Nathan Hale "I have but one asterisk for my country."
+ * funny button at Pacific Bell, * was referred to by employees as the "funny
+ button", which did not please management at all when it became
+ part of the corporate logo of Pacific Telesis, the holding
+ company ...
+ */ times-div from FORTH
= quadrathorpe half an octothorpe
- bithorpe half a quadrathorpe (So what's a monothorpe?)
. put Victor Borge on Electric Company
/ across APL
/ compress APL
+ := becomes e.g. Pascal
+ ; go-on Algol68
+ < left chevron from the military: worn vertically on the sleeve to signify
+ rating
+ < bra from quantum mechanics
+ <> unequal e.g. Pascal
+ > right chevron see "< left chevron"
+ > ket from quantum mechanics
@ snable-a from Danish; may translate as "trunk-a"
@ trunk-a "trunk" = "elephant nose"
! @ strudel as in Austrian apple cake
! @ fetch from FORTH
\ reduce APL
+ ^ and from formal logic
+ ^ pointer from PASCAL
+ _ gets some alternative representation of underscore resembles a
+ backarrow
+ ` execute from shell command substitution
{} Tuborgs from advertizing for well-known Danish beverage
+ {} curly chevr. see "< left chevron"
+ {} hitchcocks from the old Alfred Hitchcock show, with the stylized profile
+ of the man
| broken line EBCDIC has two vertical bars, one solid and one broken.
~ enyay from the Spanish n-tilde
() nil LISP
More information about the Comp.unix.questions
mailing list