![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
|
|
|
Thread Tools | Display Modes |
|
#11
|
|||
|
|||
|
On 2006-01-18, primitiveworker wrote:
I'm usually content to simply get these kinds of quick-and-dirty scripts to work and then forget them. Thank you very much for your script-fu. You're welcome. Could you (or anyone else) please send me a sample game in Yahoo format? The date format that yahoo produces just happens to be exactly the default output format of GNU's date -- "Tue Jan 17 20:59:41 MST 2006". This converts it to PGN format without using an external command: DATEYAHOO="Tue Jan 7 20:59:41 MST 2006" set -- $DATEYAHOO y=$6 m=$2 d=$3 PGNTIME=$4 ## Convert month name to number mm=JanFebMarAprMayJunJulAugSepOctNovDec idx=${mm%%$m*} m=$(( (${#idx} + 4 ) / 3 )) ## Pad month and day with 0 if necessary case $m in ?) m=0$m ;; esac case $d in ?) d=0$d ;; esac PGNDATE=$y.$m.$d -- Chris F.A. Johnson http://cfaj.freeshell.org ================================================== ================= Author: Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress) |
|
#12
|
|||
|
|||
|
In article ,
David Richerby wrote: Ari Makela wrote: Simon Krahnke wrote: What is pure sh? I have no POSIX to cite, but my /bin/ash surely supports functions, and almost all system scripts depend on that. The original Bourne Shell is not POSIX compatible, is it? AFAIK it does not have functions but I have not checked. By ``pure sh'', I meant the original Bourne shell, yes. It isn't POSIX- compliant because it predates POSIX by quite some time. I'm fairly sure it doesn't have functions. In this day and age, sh is usually a symlink to bash or something like it, Only on Linux systems. FreeBSD, for example, still maintains a "pure" Bourne shell as /bin/sh. Bash is available as a port. -- Conrad J. Sabatier -- "In Unix veritas" |
|
#13
|
|||
|
|||
|
In article ,
Simon Krahnke wrote: * David Richerby (13:27) schrieb: By ``pure sh'', I meant the original Bourne shell, yes. It isn't POSIX- compliant because it predates POSIX by quite some time. I'm fairly sure it doesn't have functions. I'm fairly sure no one's using the original Bourne shell in 2006. For interactive use, this is largely true. However, for system scripts and such, the Bourne shell is still quite predominant. -- Conrad J. Sabatier -- "In Unix veritas" |
|
#14
|
|||
|
|||
|
Conrad J. Sabatier wrote:
Simon Krahnke wrote: David Richerby (13:27) schrieb: By ``pure sh'', I meant the original Bourne shell, yes. It isn't POSIX-compliant because it predates POSIX by quite some time. I'm fairly sure it doesn't have functions. I'm fairly sure no one's using the original Bourne shell in 2006. For interactive use, this is largely true. However, for system scripts and such, the Bourne shell is still quite predominant. But, as Simon points out, not the *original* Bourne shell. It turns out you'd be hard pressed to find a Bourne shell without functions at any time in the last twenty years. Dave. -- David Richerby Flammable Dangerous Projector (TM): www.chiark.greenend.org.uk/~davidr/ it's like a 16mm film projector but it could explode at any minute and it burns really easily! |
|
#15
|
|||
|
|||
|
* Conrad J. Sabatier (2006-02-05) schrieb:
David Richerby wrote: By ``pure sh'', I meant the original Bourne shell, yes. It isn't POSIX- compliant because it predates POSIX by quite some time. I'm fairly sure it doesn't have functions. In this day and age, sh is usually a symlink to bash or something like it, Only on Linux systems. FreeBSD, for example, still maintains a "pure" Bourne shell as /bin/sh. Bash is available as a port. But they both support functions and other POSIX features, which the original bourne shell did not have. When writing a shell script in these days you can be sure, that the /bin/sh running it will fairly POSIX compatible and support functions. Unless you are writing for a computer museum. End of discussion? This group is about computer chess, not shell scripts. mfg, simon .... l |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| rec.games.chess.misc FAQ [2/4] | pribut@yahoo.com | rec.games.chess.misc (Chess General) | 0 | January 3rd 06 06:04 AM |
| rec.games.chess.misc FAQ [2/4] | pribut@yahoo.com | rec.games.chess.misc (Chess General) | 0 | December 19th 05 05:36 AM |
| rec.games.chess.misc FAQ [2/4] | pribut@yahoo.com | rec.games.chess.misc (Chess General) | 0 | December 4th 05 05:29 AM |
| rec.games.chess.misc FAQ [2/4] | pribut@yahoo.com | rec.games.chess.misc (Chess General) | 0 | November 3rd 05 05:30 AM |
| rec.games.chess.misc FAQ [2/4] | pribut@yahoo.com | rec.games.chess.misc (Chess General) | 0 | October 19th 05 05:37 AM |