Unix Technical Forum

Re: Small bash/csh script interpretation ?

This is a discussion on Re: Small bash/csh script interpretation ? within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> > On Thu, 28 Feb 2008, problems@gmail wrote: > > I want to view char(13)-line-terminated files directly via mc. ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-01-2008, 01:28 PM
William Hunt
 
Posts: n/a
Default 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 <inputFile> | 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
<typeInAveryLongName> with one-key-stroke.

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

Thanks,

== Chris Glur.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-01-2008, 05:21 PM
zentara
 
Posts: n/a
Default Re: Small bash/csh script interpretation ?

On Sat, 01 Mar 2008 06:23:00 -0600, problems@gmail,William Hunt
<w[36]...@prv8.net> 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-04-2008, 06:22 AM
Chris F.A. Johnson
 
Posts: n/a
Default 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 | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-04-2008, 06:22 AM
Dan C
 
Posts: n/a
Default 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".

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:32 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com