[magick-users] Automatic conversion Linux shell script -> DOS / Windows batch file
Anthony Thyssen
A.Thyssen at griffith.edu.au
Sun May 10 22:51:47 PDT 2009
On Fri, 8 May 2009 15:13:26 -0700
Fred Weinhaus <fmw at alink.net> wrote:
| Wolfgang,
|
| Just something for you to consider in your efforts.
|
| Note that many of my scripts use other Unix calls. The ones that come
| to mind are:
|
| bc
| sed
| grep
| expr
| sort
| tr
| wc
|
| and any number of various looping mechanisms:
|
| while
| until
| for
|
| and conditionals
|
| if, elif, else
|
| and
|
| ternary expr?true:false
|
|
| I have no idea what might be available for use in Windows batch files
| (without cygwin or something like that).
|
| I certainly am no Windows expert as I rarely use it.
|
The script probbaly should limit itself with convert commands
not full shell scripts. That is a lot more difficult!
Comment handling should only be done if a space preceeds the '#'
otherwise it may be a color such as '#FFBBCC' or xc:#00BBCC
# Replace the UNIX comment sign '#' by two double colons '::'
# ensuring it is at the start of a line.
# WARNING: do not do if a non-space is before the '#' (color!)
s/^ *#/::/
s/\(.\) *#/\1\n::/
In unix you can make the script executable and start it with
#!/bin/sed -f
Then you can run it like
im_unix2win.sed linux_command > window_command
Ending the script name in ".sed" is optional, but probably a good idea.
Anthony Thyssen ( System Programmer ) <A.Thyssen at griffith.edu.au>
-----------------------------------------------------------------------------
"The first rule of magic is simple. Don't waste your time waving your
hands and hoping when a rock or a club will do." -- McCloctnik the Lucid
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
More information about the Magick-users
mailing list