MonkeyFish Editor

J Knight

$Id: monkeyfish.sgm 137 2006-03-06 03:14:56Z jimbag $

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation.

All your base belong to me.

$LastChangedDate: 2006-03-05 22:14:56 -0500 (Sun, 05 Mar 2006) $

Abstract

This document describes the MonkeyFish Editor version 0.1.

MonkeyFish is a text editor with features oriented toward programmers and programming.


Table of Contents

Introduction
1. The MonkeyFish Environment
The Environment
The Editor
The Sidebar
The Output Window
2. Editing
Basic Editing
Starting the Editor
Create a New File
Open a File
Save a File
Editing Text
Undo and Redo
Find and Replace Text
Advanced Editing
Syntax Highlighting Mode
Indenting Blocks of Text
Matching Brace
Executing scripts
Macros
Editor Keys
Emacs Mode
3. Programming
Projects
Toolbar
Popup Menu
Files, Directories, Groups
Sources
Tools
Build
Execute
Debug
Source Control
4. Scripting
Basic Scripting
Introduction
Examples
Globals
The mf table.
The Editor Object
5. Bugs - Notes
Known Bugs
Notes
6. FQs
FAQ - Frequently Answered Questions
FUQ - Frequently Unanswered Questions
Index

List of Figures

1. MonkeyFish editing its docs on Gnome/Gentoo
2. MonkeyFish editing itself on os/x
3. MonkeyFish on Windows XP

List of Tables

2.1. Editor Key Bindings
2.2. Emacs Key Bindings
4.1. Global Variables
4.2. Global Functions
4.3. The mf table
4.4. Editor Object

Introduction

MonkeyFish is a text editor with features oriented toward programmers and programming. It aims to be as general as possible so as to be useful in as wide an array of tasks as possible.

MonkeyFish was born of the need to have an environment that was familiar and consistant and across platforms and programming language specificities. Moving back and forth between OS/X and Linux for programming tasks, it became tedious to deal with the peculiarities of the different environments for editing and project management tasks. Even moving between language environments on the same platform can become irksome if your hotkeys are different or syntax highlighting appears differently.

MonkeyFish does not attempt to push you into a language centric enviroment. Eclipse, for instance, is an excellent environment with which to develop java applications but leaves a lot to be desired when handling other languages. Xcode, while attempting to be a generic build tool, fails to meet the customization level needed to manage projects in anything but a C-style build cycle. Although it allows you to edit python, it is cumbersome as an environment for building python applications or even simple web sites. The fact that it is only available on the mac not withstanding.

MonkeyFish offers:

  • A cross-platform solution available for X11, OS/X, Windows. MonkeyFish is built with wxWidgets, a cross-platform native UI framework.

  • A familiar editing environment with multiple open files, cut, copy, paste, undo, redo, syntax highlighting, autocompletion and macros. MonkeyFish utilizes the Scintilla editor.

  • An enviroment in which to manage disk files, copy, delete, rename, etc.

  • An environment with which to manage projects of source material used to produce products such as web sites and programs.

  • A scripting framework with which to customize the behavior of the environment to suit the production task at hand. MonkeyFish embeds and enhances the Lua language for scripting.

  • Simple access to svn and cvs via the project tree.

MonkeyFish, by design, does not offer some things you may be expecting to find in an IDE. There is no class browser or wizards or boxes popping up in the middle of your typing. There is no paper clip helper or UML editor. In fact, you can think of MonkeyFish not as an IDE (Integrated Development Environment) but as a UIDE (Unintegrated Delevelopment Environment). There are tools available that do class browsing, SCM, debugging, etc that are all specific and far more featureful then any one IDE can offer. MonkeyFish just gives you a way to hook those tools into your production cycle without trying to replace them.

For example, MonkeyFish does not know how to build anything nor does it care how you build anything. If you are using Java, then use Ant or Maven for your builds. If you are building C++ then Autotools or SCons may suit you. If you are building a Ruby app then you don't need to compile anything, just run it. MonkeyFish aims to make these things convienent without getting in the way of them. Want to use plain "cvs diff", go ahead. If you'd rather use Meld to view your diffs, it's easy to add it to the tool chain!

ScreenShots

Figure 1. MonkeyFish editing its docs on Gnome/Gentoo

MonkeyFish editing its docs on Gnome/Gentoo

Figure 2. MonkeyFish editing itself on os/x

MonkeyFish editing itself on os/x

Figure 3. MonkeyFish on Windows XP

MonkeyFish on Windows XP

Chapter 1. The MonkeyFish Environment

The Environment

The MonkeyFish enviroment is simple and clean. It mainly consists of a tabbed editor window that allows you to read and write text files and manipulate the contents. There are three panes available. The editor generally takes up most of the screen area. There is a sidebar to the left that contains a project view and a view to the disk and an output window at the bottom that show you the output from any executed commands. Both the sidebar and the output window can be hidden to keep thing uncluttered.

The Editor

The editor is an embedded Scintilla editor that you may have encountered by using tools such as KDevelop or Anjuta. It is a full featured editing environment with syntax highlighting for many programming languages.

The Sidebar

The side bar contains a project window and a directory window. The directory window gives full access to the disk and allows you to edit, delete, rename, create new folders and execute files. The project window allows you to gather resources you need to construct programs in a convienient tree along with the tools you may need for construction.

The Output Window

The output window shows the output from any commands you may execute. It is hooked into the "print" function in the scripting environment. It also allows you to move between errors, save the output and kill the currently running process.

Chapter 2. Editing

Basic Editing

Type stuff. Save it!

Starting the Editor

You start the editor by clicking on it's icon or typing monkeyfish at the prompt.

        bash$ monkeyfish
      

Create a New File

To create a new file, choose File->New (Ctrl-N) The application will then display a new tab in the editor window.

Open a File

To open a file, choose File->Open (Ctrl-O). The application will open a file selector to allow you to choose a file. The file will be opened on a new tab on the editor window. If the file is already open, the tab for that file will be selected.

Save a File

To save a file, choose File->Save (Ctrl-S) . The application will open a file selector to allow you to choose a file.

Editing Text

You can edit text in the following ways:

  • Type new text from the keyboard.

  • Copy selected text to the clipboard. Edit->Copy (Ctrl-C)

  • Delete or Cut selected text to the clipboard. Edit->Cut (Ctrl-X)

  • Paste from the clipboard. Edit->Paste (Ctrl-V)

Undo and Redo

You can undo your last edit with Edit->Undo (Ctrl-Z).

You can redo your last undo with Edit->Redo (Ctrl-Shift-Z).

Find and Replace Text

Edit->Find (Ctrl-F)

Advanced Editing

MonkeyFish has some more advanced features that are oriented toward programming and manipulating program code.

Syntax Highlighting Mode

Set the syntax highlighting mode by choosing Tools->syntax and then selecting the language style you want to use.

Syntax highlighting is confgured via scripts. Open the Tools->Scripts... menu and navigate to the syntax subdirectory and look at one of the sytax files therein for an example. You can add new languages there and they will be picked up the next time MonkeyFish launches.

Currently there is no UI element to use to associate scripts with file extentions. If you want to add new associations you need to edit the config script by hand or the registry in windows (see below). Open the file "$HOME/.MonkeyFish" in GTK or "$HOME/Library/Preferences/MonkeyFish Preferences" in os/x

[files]
[files/exts]
		

If those sections are not there you can add them. Underneath [files/exts] you can make your association to scripts by adding the file extention and the script name without the path like so...

[files]
[files/exts]
java=Java.mf
xml=xml.mf
html=xml.mf
cpp=CPP.mf
mf=Lua.mf
		

Windows

True to windows, MonkeyFish stores its settings in the registry rather then a text file. To edit these settings you need to go into the registry editor (regedit) and edit the tree beneath [HKEY_CURRENT_USER->Software->MonkeyFish]. You should be able to figure out the translation between the file based tree and the registry tree given the example above. In the future you will be able to edit these from the preferences dialog.

Indenting Blocks of Text

You can indent and unindent the current selection with Edit->Indent (Ctrl-]) and Edit->Unindent (Ctrl-[) respectively.

Matching Brace

You can select a block of text between braces by putting the caret before the brace in question and choosing Edit->Match Brace.

Executing scripts

You can execute a buffer or a selection of a buffer with Tools->Execute Selection (Ctrl-Shift-E). This is a quick way to debug scripts while editing them.

Macros

There is a macro facility available via the Ctrl-1 to Ctrl-9 keys. Macros are MonkeyFish scripts that are accessable instantly with the above mentioned keys. Macros are hooked to scripts in your $SCRIPTDIR called "macro1.mf" up to "macro9.mf". They can perform any operation available to scripts.

For example, lets create a macro to insert a C-style comment. Open "Tools->Scripts" and edit the file "macro1.mf". Add the following text to it and save it...

		
comment = [[
/**
 *
 */
]]

assert( mf, "MonkeyFish not available")
e = assert(mf.selected(), "No editor selected")
e:insert( comment, e:go("bol") )
		

Now place the caret at the first line of a function or method definition in some code and press Ctrl-1.

Editor Keys

Table 2.1. Editor Key Bindings

Editor Key Bindings
Key BindingDescription 
Down ArrowMove caret down one line. 
Shift Down ArrowMove caret down one line extending the selection. 
Ctrl Down ArrowScroll document down keeping the caret visible. 
Up ArrowMove caret up one line. 
Shift Up ArrowMove caret up one line extending the selection. 
Ctrl Up ArrowScroll document up keeping the caret visible. 
Left ArrowMove caret left one character. 
Shift Left ArrowMove caret left one character extending selection. 
Ctrl Left ArrowMove caret left one word 
Ctrl Shift Left ArrowMove caret left one word extending selection. 
Right ArrowMove caret right one character. 
Shift Right ArrowMove caret right one character extending selection. 
Ctrl Right ArrowMove caret right one word 
Ctrl Shift Right ArrowMove caret right one word extending selection. 
HomeMove caret to before first visible character on line. If it is already there move to the first character on line. 
Shift HomeLike Home but extending the selection. 
Ctrl HomeMove caret to the first position in the buffer. 
Shift Ctrl HomeMove caret to the first position in the buffer, extending the selection. 
EndMove caret to the last position on line. 
Shift EndMove caret to the last position on line, extending the selection. 
Ctrl EndMove caret to the last position in the document. 
Shift Ctrl EndMove caret to the last position in the document, extending the selection. 
Page UpMove caret one page up 
Shift Page UpMove caret one page up, extending the selection. 
Page DownMove caret one page down 
Shift Page DownMove caret one page down, extending the selection. 
DeleteDelete character to the right of the caret. 
Shift DeleteCut selection to the clipboard 
Ctrl DeleteDelete the word to the right of the caret. 
Shift Ctrl DeleteDelete from caret to the end of the line. 
InsertToggle overtype mode. 
Shift InsertPaste 
Ctrl InsertCopy seleciton to the clipboard. 
BackspaceDelete the selection, if no selection, delete character to left of caret. 
Shift BackspaceSame as backspace 
Ctrl BackspaceDelete word to the left of the caret. 
Shift Ctrl BackspaceDelete from caret tot he start of the line. 
Ctrl ZUndo action 
Shift Ctrl ZRedo action 
Ctrl XCut selection 
Ctrl CCopy selection 
Ctrl VPaste 
Ctrl ASelect All 
TabIf selection is empty or all on one line, replace the selection with TAB character. If more then one line selected, indent the lines. 
Shift TabDedent the selected lines 
Ctrl LCut line 
Shift Ctrl LDelete line 
Ctrl TSwitch current line with previous line 
Ctrl UTransform selection to lowercase 
Shift Ctrl UTransform selection to uppercase 
   

Emacs Mode

There is an emacs key compatibility mode because, lets face it, you can't really be productive as a programmer without emacs bindings. Of course it's not a fully compatible mode since MonkeyFish is not emacs, but there is enough to hopefully keep you comfortable and productive.

Table 2.2. Emacs Key Bindings

Emacs Key Bindings
Key BindingDescription 
Ctrl-X Ctrl-FOpen a file 
Ctrl-X Ctrl-SSave file 
Ctrl-X Ctrl-WSave file as 
Ctrl-X 0Close file 
Ctrl-FForward character 
Ctrl-BBackward character 
Ctrl-PPrevious line 
Ctrl-NNext line 
Esc FForward word 
Esc BBackward word 
Ctrl-ABeginning of line 
Ctrl-EEnd of line 
Esc >End of document 
Esc <Beginning of document 
Ctrl-WKill selection 
Ctrl-KKill line 
Ctrl-YPaste selection 
Ctrl-_Undo edit 
Ctrl-X Ctrl-RRedo edit 

Chapter 3. Programming

Projects

  1. Type stuff

  2. Compile it

  3. Run it

  4. Fix it

  5. Goto 1

Toolbar

The toolbar in the project window offers easy access to some common functions. You can open and save projects with the first two buttons.

The next three buttons are hooked into the "Tools" branch of the project tree. If you click on the "Build" button it looks for an entry called "Build" under the "Tools" branch and excutes that. It can either be a Shell tool or a Script tool. "Execute" and "Debug" work them same way. The tool itself can do anything you need so "Build" may run make or it may be hooked into a script that writes a letter to congress.

Popup Menu

The popup menu in the project window offers access to various functions depending on the context.

Right-click on the project root:

  • Properties - allows you to manage project properties.

  • New Project - creates a new blank project.

  • New from template... - opens a new project and unzips it into the selected directory. Project templates are simply zip files with the project structure therein. As the files are written a simple substitution can can take place where any file that contains the text "$MF_PROJECT_NAME$" is substituted with the actual project name.

  • Open Project - opens a project.

  • Save Project - saves the current project.

  • Save Project As... - saves the current project under a new name.

Right-click on a file or directory:

  • Properties - allows you to view some file properties.

  • Edit - opens the file in the editor.

  • Rename - renames the file on disk.

  • Delete - deletes the file from the disk.

  • SVN or CVS submenu. - if you have SVN or CVS in the folder this file is in, the appropriate menu is displayed.

Files, Directories, Groups

The project window allows you to organize your source artifacts into more easily managed work areas.

Sources

This branch allow you to organize your source material by grouping files and directories into sensible branches without the clutter of looking at the full file system.

Tools

Tools can either be shell commands or MonkeyFish scripts. You can add a new tool by right-clicking on the Tools item in the project tree and selecting either Add Tool AddScript. A text input dialog will popup allowing you to enter the tool parameters. You can add separate commands, one per line or simply the path to a script if adding a script tool.

If you wanted to run "make" from a Build tool, you would name the tool "Build" and the command would be...

"make"

.

Multiple shell tool commands are entered one per line. For example to execute your wxpython program, add a tool called "Execute" and enter the following in the command window...

cd src
python myWxPy.py
	  

Note: Windows

Some windows programs have no I/O streams so the default is to not try and collect output from shell tool commands. Running "make" will produce nothing in the output window. In order to see output from a command in the output window you should preface the command with a vertical bar '|' like: "cd src;|make". The bar is ignored on other platforms so you can leave it in your project if you are moving between platforms. If you try and collect output from a program that has no output streams, the program will not run. e.g. "|notepad" will not work but "notepad" works as expected.

Script tool commands are simply the path to the script itself. If you wanted to run a script called "debug.mf" you would simply add

"Debug#scripts/debug.mf"

. You can portably do pretty much anything you need to with a script command.

Build

This tool is triggered, if present, from the toolbar Build button. If you wanted to run ant when the build button is pressed, add a Shell Tool as

"Build#ant"

.

Execute

This tool is triggered, if present, from the toolbar Execute button. If you wanted to execute the program you are working on by clicking this button add a Shell Tool as

"Execute#cd build;myproggy"

.

Debug

This tool is triggered, if present, from the toolbar Debug button. If you wanted to run the debugger by clicking on the Debug button add a Shell tool as

"Debug#cd src;gdb myproggy"

.

Source Control

MonkeyFish allows you to access the most frequently used tools of either svn or cvs. The app detects automatically the presence of either and pops up a relevant menu.

Currently you can:

  • Update

  • Commit

  • Status

  • Log

  • Add

  • Remove

  • Diff

At the moment there is no way to edit the SCM commands other then by editing the config file or the registry if you are on windows (see below). To do this, edit "$HOME/.MonkeyFish" in GTK or "$HOME/Library/Preferences/MonkeyFish Preferences" in os/x and examine the following lines...

[tools]
svn.update=svn update %file%
svn.commit=svn commit -F %tmpname% %file%
svn.status=svn status %file%
svn.log=svn log %file%
svn.add=svn add %file%
svn.remove=svn remove -F %tmpname% %file%
svn.diff=svn diff %file%
cvs.update=cvs update %file%
cvs.commit=cvs commit -F %tmpname% %file%
cvs.status=cvs status %file%
cvs.log=cvs log %file%
cvs.add=cvs add %file%
cvs.remove=cvs remove -F %tmpname% %file%
cvs.diff=cvs diff %file%
	  

There are three variables that get replaced in your command.

  • %tmpname% is replaced by the temporary filename for comments. Comments are called from the commit and remove commands.

  • %file% is replaced by the full path to the file or directory. In the case of a file, the file name is included.

  • %path% is replaced by the path to the file or directory. In the case of a file, the file name is excluded.

For example, to change your setup to use Meld to examine diffs, change the relevant line in the config to "svn.diff=meld %path%".

If you have more detailed needs or are using another SCM system you can always add a Tool that will handle the job.

Windows

True to windows, MonkeyFish stores its settings in the registry rather then a text file. To edit these settings you need to go into the registry editor (regedit) and edit the tree beneath [HKEY_CURRENT_USER->Software->MonkeyFish]. You should be able to figure out the translation between the file based tree and the registry tree given the example above. In the future you will be able to edit these from the preferences dialog.

Chapter 4. Scripting

Basic Scripting

Type stuff. Run it. Make it type stuff.

Introduction

MonkeyFish uses Lua for its scripting engine. Lua is a light-wieght programming language designed for extending applications. It combines a procedural syntax with a powerful data description constructs based on associative arrays and extensible semantics. It is dynamically typed and has automatic garbage collection.

Here is an example of a simple MonkeyFish script...

	
-- open a new file and get the editor object
e = mf.new()
-- insert some text into the editor
e:insert("Welcome to MonkeyFish", 0 )
-- save the file to disk
mf.save( "junk.txt" )
    

You can open a new editor and paste this text in. Then type Ctrl-Shift-E to execute it directly. There is no need to save it first.

You should read the documentation in the Lua manual in order to understand the power of the language. As an embedded language MonkeyFish offers some additional constructs that allow you to manipulate the environment.

Examples

These are some ideas and examples of the useage of scripting in the MonkeyFish environment.

Templates

One of the simplest things you can do with scripting is create templates for new files in your projects. If we are creating new HTML files all the time we can create some boiler-plate code quite easily that allows us to start with a common structure.

Go to Tools->New... and create a new script called "xhtml.mf". The type the following in:

    
text = [[
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
	"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Language" content="en-us" />
  <meta name="ROBOTS" content="ALL" />
  <meta name="Copyright" content="" />
  <meta name="Keywords" content="" />
  <meta name="Description" content="" />
  <meta name="MSSmartTagsPreventParsing" content="true" />
  <style type="text/css" media="all">
    @import "master.css";
  </style>
  
  <title></title>
  
</head>
<body>
</body>
</html>
]]

e = mf.new()
e:insert( text, 0 )
    
	

Now we can choose Tools->xhtml and a new file is opened for us with this common structure.

Globals

There are some globals available to your script from within the MonkeyFish scripting environment.

Table 4.1. Global Variables

Global Variables
VariableDescription 
LUA_PATHSet to the scripts directory of your installation. 
MF_OS An integer representing the current platform.  
MF_OS_DESC Returns a string containing a description of the current platform. It may return string like "Window NT Version 4.0" or "Linux 2.2.2 i386".  
mfThe MonkeyFish application itself expressed as a table. 
   

Table 4.2. Global Functions

Global Functions
FunctionReturns/TypeDescription
getcwd()stringGet the current workling directory.
chdir("path")nil on failureChange the current working directory.
tmpname()string Get a temporary file name.
print("text")nilPrints text to the MonkeyFish output window.
   

The mf table.

The mf table allows you to interact with the MonkeyFish enviroment itself.

Table 4.3. The mf table

The mf table
FunctionReturnsDescription
mf.message("text" [,"title"])boolean (true if user picked ok or false if cancelled) Popup a message box with the text. If the last character is a question mark '?' a question icon is used and the cancel button is shown. If the last character of msg is an exclamation mark '!' an error icon is used and the cancel button is shown. Otherwise, an information icon is used, only the OK button is shown. You can optionally add a title to the box.
mf.gets("prompt"[,"title","default"])string or nil Gets text from the user in a dialog box. Optionally "title" is the title on the box and "default" is the default input text.
mf.getsml("prompt" [,"title","default"])string or nil Gets a mutli-line text from the user in a dialog box. Optionally "title" is the title on the box and "default" is the default input text.
mf.choice("item1 item2"[,"title","prompt"])string or nil Allows the user to choose from a list of items. Optionally "title" is used as the title for the dialog and "prompt" is used as a prompt.
mf.askdir(["prompt","defaultdir"])string or nilAsks the user to choose a directory.
mf.askfile("open|save"[,"prompt","defaultdir","defaultfile","wildcards"])string or nilAsks the user to choose a file. An open or save dialog is shown depending on the first parameter.
mf.askfiles(["prompt","defaultdir","defaultfile","wildcards"])table of filenames or nilAsk the user to choose multiple files.
mf.tabcount()integerReturns the number of open files.
mf.open("filename")editor object or nil Opens a file in a new tab or if it is already open, selects that tab.
mf.save("filename")nilSaves the current editor to "filename".
mf.new()editor object or nilOpens an empty editor.
mf.close( [bool] )bool (true if succesful) Closes the current editor. If the arg bool is true (the default), the editor tries to save the file. If false, the editor is closed with the loss of data.
mf.select(#)nilSelect editor tab #
mf.selected()editor object or nilReturns the selected editor
mf.version()stringMonkeyFish version string of the form "0.0.0"
   

The Editor Object

The editor object allows you to interact with the text in an edit buffer. The editor is zero based so the first position is 0 and the first line is 0.

Table 4.4. Editor Object

Editor Object
FunctionReturnsDescription
e:get()stringGet the text from the editor.
e:set("text")bool Sets the text in the editor to text. Erases the text currently in the editor.
e:insert("text"[, pos ])integer (the inserted text length) Inserts "text" at the pos, if given, or the current insertion point.
e:delete(start, end)integer (the length of text deleted)Deletes the text between pos start and pos end.
e:filename( )string: the current file pathReturn the buffers file name.
e:goto( pos )integer (the new position) or nil if invalid posMove caret to pos
e:go( location )integer (the new position) or nil if invalid location Move caret to location. Location is a string with one of the following:
  • "bol" = beginning of line

  • "eol" = end of line

  • "bob" = beginning of buffer

  • "eob" = end of buffer

e:gotoline( # )integer (the new line) or nil if invalid lineMove caret to line #. Line numbers are zero based.
e:pos()integerReturn the current position
e:len()integerLength of the buffer in chars
e:linecount()integerNumber of lines in the buffer.
e:line( lineno )string or nil if invalid linenoReturns the line at lineno. Line numbers are zero based.
e:select( pos1, pos2 )integer, the selection start position Create a selection region from pos1 to pos2. If pos2 is negative then pos2 is set to the end of the buffer. If pos1 is negative then pos1 is set to the value of pos2: this will remove the selection. The caret will always be visible after this call.

Chapter 5. Bugs - Notes

Table of Contents

Known Bugs
Notes

Known Bugs

This is a list of the known bugs/issues at the time this documentation was prepared. It at least contains the most serious known defects at the time of publication.

Notes

These are some random notes, ideas, plans and annoyances.

Chapter 6. FQs

FAQ - Frequently Answered Questions

General

1. Who the *^@#%@ is responsible for this mess?
2. Why?
3. Executing a command complains it can't find files
1.

Who the *^@#%@ is responsible for this mess?

/me points

2.

Why?

The simple answer is that I became frustrated moving between Gnome and the Mac. I used TextMate and Xcode on the mac and, well, I couldn't find anything I liked in Linux. So I thought I'd whip something up quick with wxWidgets and Scintilla use that. So I did. Then I thought, "Hey, it would be handy it could ...". Next thing ya know...

3.

Executing a command complains it can't find files

If you are in unix, executing a command does not actually run the shell so globbing does not happen. For instance, if you try and run "grep TODO src/*.cpp" grep will complain with "grep: src/*.cpp: No such file or directory". The trouble is there is no shell to expand the file names for grep. The solution is to have the shell invoke the command:

sh -c "grep TODO src/*.cpp"
		  

FUQ - Frequently Unanswered Questions

General

1. Did men really land on the moon?
1.

Did men really land on the moon?

?

Index

E

Editing, Basic, Basic Editing