From help-octave-request at bevo dot che dot wisc dot edu Wed Jan 14 16:37:17 2004 Subject: Re: alias-like function? From: =?ISO-8859-1?Q?S=F8ren_Hauberg?= To: help-octave Date: Wed, 14 Jan 2004 23:36:21 +0100 Wov! That's quite a hack :-) The problem is that I don't have root access to all the machines I work with, so it's not really an option. Soren Geraint Paul Bevan wrote: > -----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 > ------------------------------------------------------------- > > -- De er medlemmer af "Gustav Winckler logen af 96". Når de mødes, bliver der rigtigt lyttet til Winckler-plader, og mon ikke "Hvide måge" af og til bliver lagt på grammofonen. BT, 15. januar 1998 ------------------------------------------------------------- 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 -------------------------------------------------------------