Re: Small bash/csh script interpretation ? - Slackware

This is a discussion on Re: Small bash/csh script interpretation ? - Slackware ; > 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 ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Re: Small bash/csh script interpretation ?

  1. 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.


    William Hunt wrote:
    > use 'fromdos' instead. it's part of the 'bin' package
    > and should already be on your system.
    >
    > fromdos < inputfile > outputfile
    >

    No it's not DOS. There are 3 formats: CRLF, CR, LF.
    CRLF is DOS. Of the other 2, I need to transate '13' to '10'.

    > > 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'.
    >

    Yea, but I want to be able to scroll up & down.

    > > 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'.
    >

    For some stuff, mc apparently writes to a 'temp' file and uses its
    normal viewer, to allow scrolling up and down, and then deletes
    the temp file when it exits. This what I want.

    What I've done so far is a script-file: o2u ==
    cat $1 | strings | fold
    which writes to the console, where I can do some scrolling to eg.
    cutNpaste, and I can still use mc to do
    with one-key-stroke.

    It amazes me that most people don't use mc ?

    Thanks,

    == Chris Glur.


  2. Re: Small bash/csh script interpretation ?

    On Sat, 01 Mar 2008 06:23:00 -0600, problems@gmail,William Hunt
    wrote:

    >It amazes me that most people don't use mc ?
    >Thanks,
    >== Chris Glur.


    I think many people use mc. I use it almost all the time.
    I think a poll is in order. :-)

    The configuration files for mc are in ~./mc . You can mess
    with the bindings and mc.ext files to alter it's behavior, although
    it's not always easy.

    zentara

    --
    I'm not really a human, but I play one on earth.
    http://zentara.net/japh.html

  3. Re: Small bash/csh script interpretation ?

    On 2008-03-01, zentara wrote:
    >
    > I think many people use mc. I use it almost all the time.
    > I think a poll is in order. :-)


    I hate it. It combines the worst aspects of the command line with
    the worst aspects of a GUI. I use either the command line or a real
    GUI.

    --
    Chris F.A. Johnson, author |
    Shell Scripting Recipes: | My code in this post, if any,
    A Problem-Solution Approach | is released under the
    2005, Apress | GNU General Public Licence

  4. Re: Small bash/csh script interpretation ?

    On Sat, 01 Mar 2008 16:01:41 +0000, zentara wrote:

    > I think many people use mc. I use it almost all the time.
    > I think a poll is in order. :-)


    I think mc is a POS, and never use it.

    If I want a graphical file manager, I'll use one in X, such as thunar or
    nautilus. Much easier/better than mc.

    If I'm already at the command line, I'll use the command line.


    --
    "Ubuntu" -- an African word, meaning "Slackware is too hard for me".


+ Reply to Thread