help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: alias-like function?


From: Geraint Paul Bevan
Subject: Re: alias-like function?
Date: Wed, 14 Jan 2004 22:13:34 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Søren Hauberg wrote:
| Hi all,
| I'm using octave 2.1.50 on linux.
| I'm looking for something like the shell command "alias" for octave. I
| would like to have color output when typing ls. I can achive this by
| typing "ls --color" but I don't want to do this all the time. I could
| define a function
| function ls_tmp(), ls --color, end;
| but then I wouldn't be able to type "ls" I would have to type "ls_tmp"
| (or what ever the function would be called).
| So is there an alias-like command for octave?
|
| Soren
|

I don't think is possible to overload builtin functions in Octave.
However, there is a very ugly workaround you could use. If you look at
"help ls" in Octave, it tells you that "ls" uses the system command.
Therefore you can use a script to call the real 'ls' with whatever
options you want.

/usr/local/bin/ls:
#! /bin/sh
exec /bin/ls --color

Remember to make the script executable (chmod +x /usr/local/bin/ls)


- --
Geraint Bevan
http://homepage.ntlworld.com/geraint.bevan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iEYEARECAAYFAkAFvw0ACgkQcXV3N50QmNMX0wCcCgaP3UNTjYc9Jwe5hAHHd/pr
y6cAn1xEzV7op2piiTKDuG6J2CD8T+44
=eraN
-----END PGP SIGNATURE-----



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]