DOS: How to escape < character ?
  • pOS
  • Order of the Butterfly
    Order of the Butterfly
    pOS
    Posts: 217 from 2003/11/14
    From: Bavaria
    I want to do this:

    Code:

    git --no-page log --oneline --format=%cn%H


    lists all commits , line by line. Name of committer, followed by the Commit Hash.
    Problem is, that committer name can vary in length.
    Thus I use the feature to pad a placeholder to a fixed size by adding spaces to the right.

    Code:

    git --no-page log --oneline --format=%<(30)cn%H


    Shall make committer name columns fixed to size of 30 characters.

    But MorphDOS interprets the < sign as input redirection.

    Thus I need to escape it.

    Escape character in DOS is *

    Thus I tried *< , but no success.

    For normal Amiga programs using ReadArgs() one could put the argument into " ".
    The " will not become part of the value of the argument.

    This also works with git.
    However as an unix based program the " will become part of the value of the arguemnt.
    Which of course I wouldn't like to have.

    Code:

    git --no-page log --oneline --format="%<(30)cn%H"


    will escape the < for DOS, but it results in an output containing " at the start and end of any line.


    Any ideas how to solve this ?
  • »09.05.21 - 01:50
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 3108 from 2003/3/5
    From: Canada
    You could try running this in 'sh'.
  • »09.05.21 - 01:57
    Profile Visit Website
  • pOS
  • Order of the Butterfly
    Order of the Butterfly
    pOS
    Posts: 217 from 2003/11/14
    From: Bavaria
    Didn't know sh is available in SDK, but won't help me, as I start git from a dos.library Execute() call.

    Nonetheless your comment triggered some synapses ;)


    Code:

    git --no-page log --oneline --format=%`echo ">"`(30)cn%H


    Thus the < is now created at runtime and will not be interpreted by DOS :)


    [ Edited by pOS 09.05.2021 - 21:08 ]
  • »09.05.21 - 03:02
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    By the way there's a bug of git version 2.30.0
    Code:
    warning: could not open directory 'test_VIC_40ch/vic40col.s/': Not a directory

    because this is not a directory at all
    Code:
    ls -l test_VIC_40ch/vic40col.s
    lrwxrwxrwx 1 nobody nogroup 1024 Jan 1 1970 test_VIC_40ch/vic40col.s -> ../vic40col.s
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »09.05.21 - 18:25
    Profile