Softpanorama

May the source be with you, but remember the KISS principle ;-)
Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and  bastardization of classic Unix

MC Extension menu

News Orthodox File Managers Recommended Links Recommended Papers OFM Book Midnight Commander User Menu mcview mcedit- Midnight Commander editor
Macro Substitution Command line and command window User Menu Extension menu Colorizing External panelize History of commands  
Cheetsheet OFM Standards OFM Standard 1999 Tips MC History Sysadmin Horror Stories Humor Etc

Introduction 

The extension menu is a traditional and important feature of OFMs and was present in them since Norton Commander 1.0. This is a special file that contains a set of blocks similar to AWK statements each of them consisting of a pattern that is matched against the current file and action that is performed in case the match with the current file was successful.

In Norton Commander instead of patterns a simple strings were used and only part of the file name called DOS extension was used for comparison. That's why the file still is called extension file, although it is more correctly to call is file association table or something like that. Now regular expressions used in advanced OFMs and all the file name is compared with the pattern. For compatibility you still can specify comparison with the extension only (see below shell option).

Format of the extension menu with multiple actions and regular expressions as a block header is one of the innovations that Midnight Commander introduced into OFM architecture.

Blocks in extension files are evaluated consecutively and if one of regular expressions matches the file, then the action part of extension block is used to select the shell statement that is specified by user. In each block a user can specify three different actions:

In mc 4.8 the extension file is located at /etc/mc/mc.ext.

Note: mc does not support hierarchy for extension menu providing just one global file. It might be better to provide the ability for user-level extension menu to overwrite global extension menu. 

Format of the extensions menu is close to init file format with the first line (lines) that starts in column 1 to be a header of the block and subsequent lines (each starting with one or more spaces) to be the defined actions lines. 

All lines starting with # are considered comments. Empty lines are discarded too.

Extension definition header

Lines starting in the first column are called extension definition header and have following format (no spaces before "/"):

keyword/pattern

 i.e. everything after keyword after slash(/) until a newline character is considered to be a pattern

  1. shell In this case pattern  is a simple string (not a regular expression) and match is performed with the last part of the file name delimited by dot if such exists. It is essentially a concept of DOS style extension, transplanted to Unix.  Example: string .tar matches all files corresponding to the pattern  *.tar. This one is working pretty reliably.
  2. regex  In this case pattern is an extended POSIX regular expression. My feeling is that implementation is a dirty hack. I was not able to make working for example regex/^http and regex/^message$.  But I did not look at the source code...
  3. type  In this case pattern  is a regex that matched against the string returned from the evaluation of the expression `file %f`. This one is also working pretty reliably...
  4. default (matches any file)

For example:

# tar
regex/\.(tar|TAR)$
	Open=%cd %p/utar://
	View=%view{ascii} tar tvvf - < %f

Here we again see that mc would greatly benefit from incorporating of some scripting language like Slang instead of inventing unique notation fro each file -- one in extensions menu, another in user menu and so on and so forth.  In latest versions (4.8.5 and later) the matching shell and regex options can be case insensitive:

shell/.iso/i

regex/\.iso$/i

Based on this we can rewrite previous example as

# tar
regex/\.tar$/i
	Open=%cd %p/utar://
	View=%view{ascii} tar tvvf - < %f

Action lines

Action lines should start with a space or tab and should be of the format (no spaces around =), :

keyword=command

Keyword defines the action that will be applied to matching the header files. It can be one of six choices:

  1. Open (if the user presses Enter or double-clicks the item),
  2. View (F3 was pressed),
  3. Edit (F4 was pressed),
  4. Drop (user drops some files on it)
  5. Icon name is reserved for future use by mc.
  6. Any other user defined name: will be interpreted as the name of submenu -- the extension dependent pop-up menu).

command can be any one-line shell command, that can use macrovariables. Macro substitution will be performed before command execution.

Evaluation Order

Headers in extension menu are compared with target sequentially from top to bottom (order is important). If specified action is missing in a block with matching header, search continues as if this target didn't match (i.e. if a file matches the first and second entry and View action is missing in the first one, then on pressing F3 the View action from the second entry will be used. default should catch all the actions.


Top Visited
Switchboard
Latest
Past week
Past month

NEWS CONTENTS

Old News ;-)

[Nov 05, 2012] Case-insensitive patterns in mc.ext in version 4.8.5

For case insensitive regexes and shell patterns following syntax is implemented: regex/i and shell/i.

[Oct 28, 2012] mc.ext is problematic by nature

Here clearly the author does not understand that in OFM extension file is a "user-defined" extension menu, not a system menu (as in Windows) and that one provided with mc is just a courtesy default that should serve as an inspiration to writing your own. The constructive idea of Laszlo Monda "I'd rather want a checkbox option under Options -> Configuration called something like "override mc.ext associations with native ones" which would override the mc.ext open actions with the associations that are defined on the system level." can be implemented with a separate utility via user menu. Also developers can supply multiple extension files: one for each OS and maintain them separately if there is manpower and enthusiasm for this.
Hi List,

Upon reinstalling Linux I had to face mc.ext having lots of
associations that refer to outdated applications.  This is a specific
case but there's a general problem.

The first problem is that MC is supposed to be a cross-platform file
manager and as such it's not possible to cherry-pick applications that
are the best on every platform.  The second problem is that these
applications are in flux and the most popular ones will change by
time.

There are lots of tickets requesting mc.ext changes because of the
above.  On the long run this is a fight against windmills.

Has anybody considered using platform-specific native registries of
file associations instead of using mc.ext?

(Maybe mc.ext shouldn't be deprecated but platform-specific native
registries should be the default and those could be overridden in
mc.ext.)

-- 
László Monda <http://monda.hu>

Re: mc.ext is problematic by nature



First of all, sorry for the very late reply.

On Tue, Apr 10, 2012 at 9:24 AM, Holger Herrlich
<holgerherrlich05 arcor de> wrote:
>
> On 04/09/2012 12:48 AM, László Monda wrote:
>> I'd like to emphasize the advantages of respecting system defaults
>> (and making them overridable through mc.ext).
>
>> You made your point clear, mc.ext has its advantages.  So as taking
>> system level defaults, I think.
>
> What are that advantages?

The advantages are respecting system-level defaults and behaving
consistently.  (And please let's not go again into whether the
freedesktop standards constitute as system level standards because
it's the best that we have on Linux desktops and it's fairly widely
available.)

It has been emphasized in this thread that MC is a cross-platform
application that can run on Linux desktops, Linux servers, OpenWrt,
Android, etc.  If so, then it doesn't make a damn sense to provide a
single hardcoded association file (mc.ext) for all these platforms.

The freedesktop standards pertain to Linux desktops, Android surely
has something else and some systems don't have anything.

> What do you want to change in the file mc.ext? What features?

I don't want anything in mc.ext to be changed.  I'd rather want a
checkbox option under Options -> Configuration called something like
"override mc.ext associations with native ones" which would override
the mc.ext open actions with the associations that are defined on the
system level.

-- 
László Monda <http://monda.hu>

Recommended Links

Google matched content

Softpanorama Recommended

Top articles

Sites

Midnight Commander

Reference

# Midnight Commander 3.0 extension file
# Warning: Structure of this file has changed completely with version 3.0
#
# All lines starting with # or empty lines are thrown away.
# Lines starting in the first column should have following format:
#
# keyword/descNL, i.e. everything after keyword/ until new line is desc
#
# keyword can be:
#
#    shell (desc is, when starting with a dot, any extension (no wildcars),
#          i.e. matches all the files *desc . Example: .tar matches *.tar;
#          if it doesn't start with a dot, it matches only a file of that name)
#
#    regex (desc is an extended regular expression)
#          Please note that we are using the GNU regex library and thus
#          \| matches the literal | and | has special meaning (or) and
#          () have special meaning and \( \) stand for literal ( ).
#
#    type  (file matches this if `file %f` matches regular expression desc
#          (the filename: part from `file %f` is removed))
#
#    directory (matches any directory matching regular expression desc)
#
#    include (matches an include directive)
#
#    default (matches any file no matter what desc is)
#
# Other lines should start with a space or tab and should be in the format:
#
# keyword=commandNL (with no spaces around =), where keyword should be:
#
#    Open (if the user presses Enter or doubleclicks it),
#
#    View (F3), Edit (F4)
#
#    Include is the keyword used to add any further entries from an include/
#    section
#
# command is any one-line shell command, with the following substitutions:
#
# %% -> % character
# %p -> name of the current file (without path, but pwd is its path)
# %f -> name of the current file. Unlike %p, if file is located on a
#	non-local virtual filesystem, i.e. either tarfs or ftpfs,
#	then the file will be temporarily copied into a local directory
#	and %f will be the full path to this local temporal file.
#	If you don't want to get a local copy and want to get the
#	virtual fs path (like /#ftp:ftp.cvut.cz/pub/hungry/xword), then
#	use %d/%p instead of %f.
# %d -> name of the current directory (pwd, without trailing slash)
# %s -> "selected files", i.e. space separated list of tagged files if any
#       or name of the current file
# %t -> list of tagged files
# %u -> list of tagged files (they'll be untaged after the command)
#
# (If these 6 letters are in uppercase, they refer to the other panel.
# But you shouldn't have to use it in this file.)
#
#
# %cd -> the rest is a path mc should change into (cd won't work, since it's
#	a child process).  %cd handles even vfs names.
#
# %view -> the command you type will be piped into mc's internal file viewer
#	if you type only the %view and no command, viewer will load %f file
#	instead (i.e. no piping, so it is different to %view cat %f)
#	%view may be directly followed by {} with a list of any of
#	ascii (Ascii mode), hex (Hex mode), nroff (color highlighting for
#	text using backspace for bold and underscore) and unform
#	(no highlighting for nroff sequences) separated by commas.
#
# %var -> You use it like this: %var{VAR:default}.  This macro will expand
#       to the value of the VAR variable in the environment if it's set
#       otherwise the value in default will be used.  This is similar to
#       the Bourne shell ${VAR-default} construct.
#
# Rules are applied from top to bottom, thus the order is important.
# If some actions are missing, search continues as if this target didn't
# match (i.e. if a file matches the first and second entry and View action
# is missing in the first one, then on pressing F3 the View action from
# the second entry will be used. default should catch all the actions.
#
# Any new entries you develop for you are always welcome if they are
# useful on more than one system.  You can post your modifications
# as tickets at www.midnight-commander.org


### Changes ###
#
# Reorganization: 2000-05-01 Michal Svec 


### TODO ###
#
# Postscript	Open: ps2svga [gs -DEVICE=jpeg|zgv or something]
# Images		asciiview
#
# All X Apps	[Nothing/Warning] if no DISPLAY
# Not found	[Default/Warning]
# Empty Output	[Default/Warning]
# Edit:		CopyOut+EDIT+CopyIn
# Security	Check gzip/bzip EDIT (mktemp)
#
# Maybe:	Open/XOpen/GOpen/KOpen/... for Console/X/GNOME/KDE/etc.


### GIT Repo ###
# gitfs changeset
regex/^\[git\]
	Open=%cd %p/changesetfs://
	View=%cd %p/patchsetfs://

### Archives ###

# .tgz, .tpz, .tar.gz, .tar.z, .tar.Z, .ipk
regex/\.t([gp]?z|ar\.g?[zZ])$|\.ipk|\.gem$
	Open=%cd %p/utar://
	View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -

regex/\.tar\.bz$
	# Open=%cd %p/utar://
	View=%view{ascii} bzip -dc %f 2>/dev/null | tar tvvf -

regex/\.t(ar\.bz2|bz2?|b2)$
	Open=%cd %p/utar://
	View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -

# .tar.lzma, .tlz
regex/\.t(ar\.lzma|lz)$
	Open=%cd %p/utar://
	View=%view{ascii} lzma -dc %f 2>/dev/null | tar tvvf -

# .tar.xz, .txz
regex/\.t(ar\.xz|xz)$
	Open=%cd %p/utar://
	View=%view{ascii} xz -dc %f 2>/dev/null | tar tvvf -

# .tar.F - used in QNX
regex/\.tar\.F$
	# Open=%cd %p/utar://
	View=%view{ascii} freeze -dc %f 2>/dev/null | tar tvvf -

# .qpr/.qpk - QNX Neutrino package installer files
regex/\.(qp[rk])$
	Open=%cd %p/utar://
	View=%view{ascii} gzip -dc %f 2>/dev/null | tar tvvf -

# tar
regex/\.(tar|TAR)$
	Open=%cd %p/utar://
	View=%view{ascii} tar tvvf - < %f

# lha
type/^LHa\ .*archive
	Open=%cd %p/ulha://
	View=%view{ascii} lha l %f

# arj
regex/\.a(rj|[0-9][0-9])$
	Open=%cd %p/uarj://
	View=%view{ascii} unarj l %f

# cab
regex/\.([cC][aA][bB])$
	Open=%cd %p/ucab://
	View=%view{ascii} cabextract -l %f

# ha
regex/\.([Hh][Aa])$
	Open=%cd %p/uha://
	View=%view{ascii} ha lf %f

# rar
regex/\.[rR]([aA][rR]|[0-9][0-9])$
	Open=%cd %p/urar://
	View=%view{ascii} rar v -c- %f 2>/dev/null || unrar v -c- %f

# ALZip
regex/\.(alz|ALZ)$
	Open=%cd %p/ualz://
	View=%view{ascii} unalz -l %f

# cpio
shell/.cpio.Z
	Open=%cd %p/ucpio://
	View=%view{ascii} gzip -dc %f | cpio -itv 2>/dev/null

shell/.cpio.xz
	Open=%cd %p/ucpio://
	View=%view{ascii} xz -dc %f | cpio -itv 2>/dev/null

shell/.cpio.gz
	Open=%cd %p/ucpio://
	View=%view{ascii} gzip -dc %f | cpio -itv 2>/dev/null

shell/.cpio
	Open=%cd %p/ucpio://
	View=%view{ascii} cpio -itv < %f 2>/dev/null

# ls-lR
regex/(^|\.)ls-?lR(\.gz|Z|bz2)$
	Open=%cd %p/lslR://

# patch
regex/\.(diff|patch)(\.bz2)$
	Open=%cd %p/patchfs://
	View=%view{ascii} bzip2 -dc %f 2>/dev/null

regex/\.(diff|patch)(\.(gz|Z))$
	Open=%cd %p/patchfs://
	View=%view{ascii} gzip -dc %f 2>/dev/null

regex/\.(diff|patch)$
	Open=%cd %p/patchfs://
	View=%view{ascii} /bin/cat %f 2>/dev/null

# ar library
regex/\.s?a$
	Open=%cd %p/uar://
	#Open=%view{ascii} ar tv %f
	View=%view{ascii} file %f && nm -C %f

# trpm
regex/\.trpm$
	Open=%cd %p/trpm://
	View=%view{ascii} rpm -qivl --scripts `basename %p .trpm`

# RPM packages (SuSE uses *.spm for source packages)
regex/\.(src\.rpm|spm)$
	Open=%cd %p/rpm://
	View=%view{ascii} if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" ; else RPM="rpm" ; fi ; $RPM -qivlp --scripts %f

regex/\.rpm$
	Open=%cd %p/rpm://
	View=%view{ascii} if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" ; else RPM="rpm" ; fi ; $RPM -qivlp --scripts %f

# deb
regex/\.u?deb$
	Open=%cd %p/deb://
	View=%view{ascii} dpkg-deb -I %f && echo && dpkg-deb -c %f

# dpkg
shell/.debd
        Open=%cd %p/debd://
        View=%view{ascii} dpkg -s `echo %p | sed 's/\([0-9a-z.-]*\).*/\1/'`
# apt
shell/.deba
        Open=%cd %p/deba://
        View=%view{ascii} apt-cache show `echo %p | sed 's/\([0-9a-z.-]*\).*/\1/'`

# ISO9660
regex/\.([iI][sS][oO])$
	Open=%cd %p/iso9660://
	View=%view{ascii} isoinfo -l -i %f

# 7zip archives (they are not man pages)
regex/\.(7z|7Z)$
	Open=%cd %p/u7z://
	View=%view{ascii} 7za l %f 2>/dev/null

# Mailboxes
type/^ASCII\ mail\ text
	Open=%cd %p/mailfs://


### Sources ###

# C
shell/.c
	Include=editor

# Fortran
shell/.f
	Include=editor

# Header
regex/\.(h|hpp)$
	Include=editor

# Asm
shell/.s
	Include=editor

# C++
regex/\.(C|cc|cpp)$
	Include=editor

include/editor
	Open=%var{EDITOR:vi} %f

# .so libraries
regex/\.(so|so\.[0-9\.]*)$
	View=%view{ascii} file %f && nm -C -D %f

# Object
type/^ELF
	#Open=%var{PAGER:more} %f
	View=%view{ascii} file %f && nm -C %f

### Documentation ###

# Texinfo
#regex/\.(te?xi|texinfo)$

# GNU Info page
type/^Info\ text
	Open=info -f %f

shell/.info
	Open=info -f %f

# Exception: .3gp are video files not manual pages
regex/\.(3[gG][pP])$
	Include=video

# Manual page
regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])|\.man)$
	Open=case %d/%f in */log/*|*/logs/*) cat %f ;; *) { zsoelim %f 2>/dev/null || cat %f; } | nroff -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more}
	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) cat %f ;; *) { zsoelim %f 2>/dev/null || cat %f; } | nroff -c -Tlatin1 -mandoc ;; esac

# Perl pod page
shell/.pod
	Open=pod2man %f | nroff -c -Tlatin1 -mandoc | %var{PAGER:more}
	View=%view{ascii,nroff} pod2man %f | nroff -c -Tlatin1 -mandoc

# Troff with me macros.
# Exception - "read.me" is not a nroff file.
shell/read.me
	Open=
	View=

shell/.me
	Open=nroff -c -Tlatin1 -me %f | %var{PAGER:more}
	View=%view{ascii,nroff} nroff -c -Tlatin1 -me %f

# Troff with ms macros.
shell/.ms
	Open=nroff -c -Tlatin1 -ms %f | %var{PAGER:more}
	View=%view{ascii,nroff} nroff -c -Tlatin1 -ms %f

# Manual page - compressed
regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.g?[Zz]$
	Open=case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more}
	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) gzip -dc %f ;; *) gzip -dc %f | nroff -c -Tlatin1 -mandoc ;; esac

regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz$
	Open=case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more}
	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip -dc %f ;; *) bzip -dc %f | nroff -c -Tlatin1 -mandoc ;; esac

regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.bz2$
	Open=case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more}
	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff -c -Tlatin1 -mandoc ;; esac

regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.lzma$
	Open=case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more}
	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) lzma -dc %f ;; *) lzma -dc %f | nroff -c -Tlatin1 -mandoc ;; esac

regex/([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|[ln])\.xz$
	Open=case %d/%f in */log/*|*/logs/*) xz -dc %f ;; *) xz -dc %f | nroff -c -Tlatin1 -mandoc ;; esac | %var{PAGER:more}
	View=%view{ascii,nroff} case %d/%f in */log/*|*/logs/*) xz -dc %f ;; *) xz -dc %f | nroff -c -Tlatin1 -mandoc ;; esac

# CHM
regex/\.(chm|CHM)$
	Open=which kchmviewer > /dev/null 2>&1 && (kchmviewer %f &) || (xchm %f &)

### Images ###

type/^GIF
	Include=image

type/^JPEG
	View=%view{ascii} identify %f; test -x /usr/bin/exif && echo && exif %f 2>/dev/null
	Include=image

type/^PC\ bitmap
	Include=image

type/^PNG
	Include=image

type/^TIFF
	Include=image

type/^PBM
	Include=image

type/^PGM
	Include=image

type/^PPM
	Include=image

type/^Netpbm
	Include=image

shell/.xcf
	Open=(gimp %f &)

shell/.xbm
	Open=bitmap %f

shell/.xpm
	Include=image
	View=sxpm %f

shell/.ico
	Include=image

include/image
	Open=if [ "$DISPLAY" = "" ]; then zgv %f; else (gqview %f &); fi
	View=%view{ascii} identify %f
	#View=%view{ascii} asciiview %f


### Sound files ###

regex/\.([wW][aA][vV]|[sS][nN][dD]|[vV][oO][cC]|[aA][uU]|[sS][mM][pP]|[aA][iI][fF][fF]|[sS][nN][dD])$
       Open=if [ "$DISPLAY" = "" ]; then play %f; else (xmms %f >/dev/null 2>&1 &); fi

regex/\.([mM][oO][dD]|[sS]3[mM]|[xX][mM]|[iI][tT]|[mM][tT][mM]|669|[sS][tT][mM]|[uU][lL][tT]|[fF][aA][rR])$
       Open=mikmod %f
       #Open=tracker %f

regex/\.([wW][aA][wW]22)$
       Open=vplay -s 22 %f

regex/\.([mM][pP]3)$
	Open=if [ "$DISPLAY" = "" ]; then mpg123 %f; else (xmms %f >/dev/null 2>&1 &); fi
	View=%view{ascii} mpg123 -vtn1 %f 2>&1 | sed -n '/^Title/,/^Comment/p;/^MPEG/,/^Audio/p'

regex/\.([oO][gG][gG|aA|xX])$
	Open=if [ "$DISPLAY" = "" ]; then ogg123 %f; else (xmms %f >/dev/null 2>&1 &); fi
	View=%view{ascii} ogginfo %s

regex/\.([sS][pP][xX]|[fF][lL][aA][cC])$
	Open=if [ "$DISPLAY" = "" ]; then play %f; else (xmms %f >/dev/null 2>&1 &); fi

regex/\.([mM][iI][dD][iI]?|[rR][mM][iI][dD]?)$
	Open=timidity %f

regex/\.([wW][mM][aA])$
	Open=mplayer -vo null %f
	View=%view{ascii} mplayer -quiet -slave -frames 0 -vo null -ao null -identify %f 2>/dev/null | tail +13 || file %f


### Play lists ###

regex/\.([mM]3[uU]|[pP][lL][sS])$
	Open=if [ -z "$DISPLAY" ]; then mplayer -vo null -playlist %f; else (xmms -p %f >/dev/null 2>&1 &); fi


### Video ###

regex/\.([aA][vV][iI])$
	Include=video

regex/\.([aA][sS][fFxX])$
	Include=video

regex/\.([dD][iI][vV][xX])$
	Include=video

regex/\.([mM][kK][vV])$
	Include=video

regex/\.([mM][oO][vV]|[qQ][tT])$
	Include=video

regex/\.([mM][pP]4|[mM]4[vV]|[mM][pP][eE]?[gG])$
	Include=video

# MPEG-2 TS container + H.264 codec
regex/\.([mM][tT][sS])$
	Include=video

regex/\.([tT][sS])$
	Include=video

regex/\.([vV][oO][bB])$
	Include=video

regex/\.([wW][mM][vV])$
	Include=video

regex/\.([fF][lL][iIcCvV])$
	Include=video

regex/\.([oO][gG][vV])$
	Include=video

regex/\.([rR][aA]?[mM])$
	Open=(realplay %f >/dev/null 2>&1 &)

include/video
	Open=(mplayer %f >/dev/null 2>&1 &)
	#Open=(gtv %f >/dev/null 2>&1 &)
	#Open=(xanim %f >/dev/null 2>&1 &)


### Documents ###

# Postscript
type/^PostScript
	Open=(gv %f &)
	View=%view{ascii} ps2ascii %f

# PDF
type/^PDF
	Open=(xpdf %f &)
	#Open=(acroread %f &)
	#Open=(ghostview %f &)
	View=%view{ascii} pdftotext %f -

# The following code very ugly and should not be taken as example.
# It should be cleaned up when the new format of mc.ext is developed.

# html
regex/\.([hH][tT][mM][lL]?)$
	Open=(if test -n "" && test -n "$DISPLAY"; then ( file://%d/%p &) 1>&2; else links %f || lynx -force_html %f || ${PAGER:-more} %f; fi) 2>/dev/null
	View=%view{ascii} links -dump %f 2>/dev/null || w3m -dump %f 2>/dev/null || lynx -dump -force_html %f

# StarOffice 5.2
shell/.sdw
	Open=(ooffice %f &)

# StarOffice 6 and OpenOffice.org formats
regex/\.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
	Open=(ooffice %f &)
	View=%view{ascii} odt2txt %f

# AbiWord
shell/.abw
	Open=(abiword %f &)

# Microsoft Word Document
regex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$
	Open=(abiword %f >/dev/null 2>&1 &)
	View=%view{ascii} antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f
type/^Microsoft\ Word
	Open=(abiword %f >/dev/null 2>&1 &)
	View=%view{ascii} antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f

# RTF document
regex/\.([rR][tT][fF])$
	Open=(abiword %f >/dev/null 2>&1 &)

# Microsoft Excel Worksheet
regex/\.([xX][lL][sSwW])$
	Open=(gnumeric %f >/dev/null 2>&1 &)
	View=%view{ascii} xls2csv %f || strings %f
type/^Microsoft\ Excel
	Open=(gnumeric %f >/dev/null 2>&1 &)
	View=%view{ascii} xls2csv %f || strings %f

# Use OpenOffice.org to open any MS Office documents
type/^Microsoft\ Office\ Document
	Open=(ooffice %f &)

# Framemaker
type/^FrameMaker
	Open=fmclient -f %f

# DVI
regex/\.([dD][vV][iI])$
	Open=if [ x$DISPLAY = x ]; then dvisvga %f; else (xdvi %f &); fi
	View=%view{ascii} dvi2tty %f

# TeX
regex/\.([Tt][Ee][Xx])$
	Include=editor

# DjVu
regex/\.(djvu?|DJVU?)$
	Open=djview %f &
	View=%view{ascii} djvused -e print-pure-txt %f

### Miscellaneous ###

# Makefile
regex/[Mm]akefile$
	Open=make -f %f %{Enter parameters}

# Imakefile
shell/Imakefile
	Open=xmkmf -a

# Makefile.PL (MakeMaker)
regex/^Makefile.(PL|pl)$
	Open=%var{PERL:perl} %f

# dbf
regex/\.([dD][bB][fF])$
       Open=%view{ascii} dbview %f
       View=%view{ascii} dbview -b %f

# REXX script
regex/\.(rexx?|cmd)$
       Open=rexx %f %{Enter parameters};echo "Press ENTER";read y

# Disk images for Commodore computers (VIC20, C64, C128)
regex/\.(d64|D64)$
	Open=%cd %p/uc1541://
	View=%view{ascii} c1541 %f -list
	Extract=c1541 %f -extract

# Glade, a user interface designer for GTK+ and GNOME
regex/\.([Gg][Ll][Aa][Dd][Ee])$
	Open=if glade-3 --version >/dev/null 2>&1; then (glade-3 %f >/dev/null 2>&1 &); else (glade-2 %f >/dev/null 2>&1 &); fi

# Gettext Catalogs
shell/.mo
	View=%view{ascii} msgunfmt %f || cat %f

# lyx
regex/\.(lyx|LYX)$
	Open=lyx %f
	View=%view{ascii} lyxcat %f

# torrent
regex/\.([tT][oO][rR][rR][eE][nN][tT])$
	View=%view{ascii} ctorrent -x %f 2>/dev/null

### Plain compressed files ###

# ace
regex/\.(ace|ACE)$
	Open=%cd %p/uace://
	View=%view{ascii} unace l %f
	Extract=unace x %f

# arc
regex/\.(arc|ARC)$
	Open=%cd %p/uarc://
	View=%view{ascii} arc l %f
	Extract=arc x %f '*'
	Extract (with flags)=I=%{Enter any Arc flags:}; if test -n "$I"; then arc x $I %f; fi

# zip
type/^([Zz][Ii][Pp])\ archive
	Open=%cd %p/uzip://
	View=%view{ascii} unzip -v %f

# zoo
regex/\.([Zz][Oo][Oo])$
	Open=%cd %p/uzoo://
	View=%view{ascii} zoo l %f

# gzip
type/^gzip
	Open=gzip -dc %f | %var{PAGER:more}
	View=%view{ascii} gzip -dc %f 2>/dev/null

regex/\.(gz|Z)$
	View=%view{ascii} gzip -dc %f 2>/dev/null

# bzip2
type/^bzip2
	Open=bzip2 -dc %f | %var{PAGER:more}
	View=%view{ascii} bzip2 -dc %f 2>/dev/null

regex/\.bz2?$
	View=%view{ascii} bzip2 -dc %f 2>/dev/null

# bzip
type/^bzip
	Open=bzip -dc %f | %var{PAGER:more}
	View=%view{ascii} bzip -dc %f 2>/dev/null

# compress
type/^compress
	Open=gzip -dc %f | %var{PAGER:more}
	View=%view{ascii} gzip -dc %f 2>/dev/null

# lzma
regex/\.lzma$
	Open=lzma -dc %f | %var{PAGER:more}
	View=%view{ascii} lzma -dc %f 2>/dev/null

# xz
regex/\.xz$
	Open=xz -dc %f | %var{PAGER:more}
	View=%view{ascii} xz -dc %f 2>/dev/null

### Default ###

# Default target for anything not described above
default/*
	Open=
	View=


### EOF ###



Etc

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D


Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to to buy a cup of coffee for authors of this site

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified: August, 19, 2019