" /> Small bash/csh script interpretation ?

Small bash/csh script interpretation ? - Slackware

This is a discussion on Small bash/csh script interpretation ? - Slackware ; I want to view char(13)-line-terminated files directly via mc. Currently I can transform these file types to unix-text with: cat | tr "\015" "\012" > LnxFile so, I guess simply translating char(octal15=8+5=13) to char(10) is all that's required. But because ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Small bash/csh script interpretation ?

  1. Small bash/csh script interpretation ?

    I want to view char(13)-line-terminated files directly via mc.

    Currently I can transform these file types to unix-text with:
    cat | tr "\015" "\012" > LnxFile
    so, I guess simply translating char(octal15=8+5=13) to char(10)
    is all that's required.

    But because I do this so often I don't want to have to create a
    new file before I use mc to view/edit it.

    mc's customisable menu can already do other similar smart jobs.
    eg. the one existing menu entry is:--

    0 Edit a bug report and send it to root
    ${EDITOR-vi} /tmp/mail.$$
    test -r /tmp/mail.$$ && mail root < /tmp/mail.$$
    rm -f /tmp/mail.$$
    ..... or this one is close to my requirements:
    t Run latex on file and show it with xdvi
    latex %f && xdvi `basename %f .tex`.dvi
    -------------------

    Q1. is the above bash syntax or sch....?

    Q2. what mc.menu entry should I try to view my
    char(13)-line-terminated files ?

    I've started & tested as OK:
    e Show ETH-oberon format
    ls *obn


    Thanks for any feedback,

    == Chris Glur.


  2. Re: Small bash/csh script interpretation ?

    On Thu, 28 Feb 2008, problems@gmail wrote:
    > I want to view char(13)-line-terminated files directly via mc.
    > Currently I can transform these file types to unix-text with:
    > cat | tr "\015" "\012" > LnxFile
    > so, I guess simply translating char(octal15=8+5=13) to char(10)
    > is all that's required.


    use 'fromdos' instead. it's part of the 'bin' package
    and should already be on your system.

    fromdos < inputfile > outputfile

    > But because I do this so often I don't want to have to create a
    > new file before I use mc to view/edit it.


    If you just want to view the file, use less - it will
    automatically hide the CRLF.
    If you want to edit, then you'll want the output file.
    If you want to restore the CRLF, use 'todos'.


    >
    > mc's customisable menu can already do other similar smart jobs.
    > eg. the one existing menu entry is:--
    > 0 Edit a bug report and send it to root
    > ${EDITOR-vi} /tmp/mail.$$
    > test -r /tmp/mail.$$ && mail root < /tmp/mail.$$
    > rm -f /tmp/mail.$$
    > .... or this one is close to my requirements:
    > t Run latex on file and show it with xdvi
    > latex %f && xdvi `basename %f .tex`.dvi
    > -------------------
    > Q1. is the above bash syntax or sch....?


    ummmmmm, no. it's an mc menu file. It's very much
    bash syntax, but uses features interpreted only by mc.
    (eg, %f and structure).


    >
    > Q2. what mc.menu entry should I try to view my
    > char(13)-line-terminated files ?


    dunno what mc.menu provides. but, just use 'less'.

    >
    > I've started & tested as OK:
    > e Show ETH-oberon format
    > ls *obn
    > Thanks for any feedback,
    > == Chris Glur.


    HTH
    --
    William Hunt, Portland Oregon USA

+ Reply to Thread