Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

procmail modify subject, procmail alter subject, formail get body of message, www.xxxcon, www xxxcon, board.issociate.de, registrieren fehler dll server 0x8002801c, far2 vs near2 raid10, access abfragen aus linux, "Can't send mail: sendmail process failed with error code 69"

Links

XODOX
Impressum

#1: Alias to start application in background

Posted on 2006-08-15 22:31:12 by Anand

I am trying to define an alias for my editor (nedit).

alias n "nedit"

Problem is when I type

n <FILENAME> it starts the nedit app in the foreground, whereas I want
to start it in the background, equivalent to

nedit FILENAME &

How do I change my alias to start this app in the background instead of
foreground?


Thanks

Report this message

#2: Re: Alias to start application in background

Posted on 2006-08-15 22:35:56 by Sashi

anand wrote:
> I am trying to define an alias for my editor (nedit).
>
> alias n "nedit"
>
> Problem is when I type
>
> n <FILENAME> it starts the nedit app in the foreground, whereas I want
> to start it in the background, equivalent to
>
> nedit FILENAME &
>
> How do I change my alias to start this app in the background instead of
> foreground?
>
>
> Thanks
Just create a script with the name 'n' somewhere in your path with the
contents "nedit $0 &" and make it executable.
I'd also recommend that you get familiar with a better editor such as
vi or emacs.
Sashi

Report this message

#3: Re: Alias to start application in background

Posted on 2006-08-15 22:39:34 by Anand

Yes, I use emacs regularly, and nedit from time to time.
How do I do this if I dont want to write a script? I know one of my
friends used something like

alias n "nedit <&0" or something like that. I am just looking for the
syntax




Sashi wrote:
> anand wrote:
> > I am trying to define an alias for my editor (nedit).
> >
> > alias n "nedit"
> >
> > Problem is when I type
> >
> > n <FILENAME> it starts the nedit app in the foreground, whereas I want
> > to start it in the background, equivalent to
> >
> > nedit FILENAME &
> >
> > How do I change my alias to start this app in the background instead of
> > foreground?
> >
> >
> > Thanks
> Just create a script with the name 'n' somewhere in your path with the
> contents "nedit $0 &" and make it executable.
> I'd also recommend that you get familiar with a better editor such as
> vi or emacs.
> Sashi

Report this message

#4: Re: Alias to start application in background

Posted on 2006-08-15 23:01:06 by Glenn Jackman

At 2006-08-15 04:31PM, anand <writeanand@gmail.com> wrote:
> I am trying to define an alias for my editor (nedit).
>
> alias n "nedit"
>
> Problem is when I type
>
> n <FILENAME> it starts the nedit app in the foreground, whereas I want
> to start it in the background, equivalent to
>
> nedit FILENAME &
>
> How do I change my alias to start this app in the background instead of
> foreground?

Use a function instead:
n () { nedit ${1+"$@"} &; }

--
Glenn Jackman
Ulterior Designer

Report this message

#5: Re: Alias to start application in background

Posted on 2006-08-15 23:06:32 by Chris Mattern

anand wrote:
> I am trying to define an alias for my editor (nedit).
>
> alias n "nedit"
>
> Problem is when I type
>
> n <FILENAME> it starts the nedit app in the foreground, whereas I want
> to start it in the background, equivalent to
>
> nedit FILENAME &
>
> How do I change my alias to start this app in the background instead of
> foreground?
>
>
> Thanks
>

Type:

n FILENAME &


Chris Mattern

Report this message

#6: Re: Alias to start application in background

Posted on 2006-08-15 23:45:21 by dfeustel

anand <writeanand@gmail.com> wrote:
> I am trying to define an alias for my editor (nedit).
>
> alias n "nedit"
>
> Problem is when I type
>
> n <FILENAME> it starts the nedit app in the foreground, whereas I want
> to start it in the background, equivalent to

Just out of curiosity, why do you want to start the editor
in the background?

Thanks.

Report this message

#7: Re: Alias to start application in background

Posted on 2006-08-16 00:10:26 by Anand

If I have one xterm open, and I start it in the background, then I can
continue using my command prompt without opening another XTERM.

Do you have the command line?


dfeustel@mindspring.com wrote:
> anand <writeanand@gmail.com> wrote:
> > I am trying to define an alias for my editor (nedit).
> >
> > alias n "nedit"
> >
> > Problem is when I type
> >
> > n <FILENAME> it starts the nedit app in the foreground, whereas I want
> > to start it in the background, equivalent to
>
> Just out of curiosity, why do you want to start the editor
> in the background?
>
> Thanks.

Report this message

#8: Re: Alias to start application in background

Posted on 2006-08-16 04:33:31 by Bruce Barnett

"anand" <writeanand@gmail.com> writes:

> Yes, I use emacs regularly, and nedit from time to time.
> How do I do this if I dont want to write a script? I know one of my
> friends used something like
>
> alias n "nedit <&0" or something like that. I am just looking for the
> syntax

What shell do you want this to work in?

For csh/tcsh:

alias n "nedit \!* &"

Glenn suggested a function for the POSIX shells.


You can also launch a new terminal instead of runing the editor in
the background. Or use emacs/xemacs in X window mode.



--
Sending unsolicited commercial e-mail to this account incurs a fee of
$500 per message, and acknowledges the legality of this contract.

Report this message

#9: Re: Alias to start application in background

Posted on 2006-08-16 07:40:10 by Bill Marcum

On 15 Aug 2006 21:01:06 GMT, Glenn Jackman
<glennj@ncf.ca> wrote:
> At 2006-08-15 04:31PM, anand <writeanand@gmail.com> wrote:
>> I am trying to define an alias for my editor (nedit).
>>
>> alias n "nedit"
>>
>> Problem is when I type
>>
>> n <FILENAME> it starts the nedit app in the foreground, whereas I want
>> to start it in the background, equivalent to
>>
>> nedit FILENAME &
>>
>> How do I change my alias to start this app in the background instead of
>> foreground?
>
> Use a function instead:
> n () { nedit ${1+"$@"} &; }
>

The syntax 'alias n "nedit"' without an = sign implies that the OP is
using csh or tcsh, which don't have functions.

Report this message

#10: Re: Alias to start application in background

Posted on 2006-08-17 23:30:46 by brian_hiles

anand wrote:
> alias n "nedit"
> ... start this app in the background instead of foreground?

(1) Use can use ^Z (and "fg") to put a foreground task into
the background. These Job Control commands are the same
in t/csh(1) as they are in ksh(1).

(2) You could make a hardlink or symlink to "rename" "nedit"
as filename "n":

/bin/ln [-s] /path/to/nedit n

(3) As discussed, there are two techniques to allow aliases
to call functions *slash* have arguments, in either ksh(1) or
t/csh(1), both of which have been touched on in the previous
responses.

=Brian

Report this message