From: Teddy on
Hello,

I am using C shell as interactive shell because its filename
completion feature is more easy.
I have my entire list of aliases and environment is set up in C shell.

Recently due to some network overload admin has changed policy and
inactive terminal gets logged out if it reamins inactive for more than
15 mins.
I use to write one while loop like this

while(1)
echo PING
sleep 240
end

This created some action on terminal and my session doesnt gets logged
out. I want to convert this into alias

could someone suggest me how to convert this into alias. I tried this

alias infiniteping ' while(1) echo PING ; sleep 240 ; end ; '

but it again prompts me for end.

Thanks in advance.
From: Kenny McCormack on
In article <0fffeca1-6683-4272-a393-34774329bd99(a)c58g2000hsc.googlegroups.com>,
Teddy <neerajrathi2(a)gmail.com> wrote:
>Hello,
>
>I am using C shell as interactive shell because its filename
>completion feature is more easy.

Very true. Wise choice of interactive shell. I am assuming you are
actually using tcsh, not plain csh.

>I have my entire list of aliases and environment is set up in C shell.

I'm with you there. I have a nice collections of tcsh aliases built up
over the years.

>Recently due to some network overload admin has changed policy and
>inactive terminal gets logged out if it reamins inactive for more than
>15 mins.
>I use to write one while loop like this
>
>while(1)
>echo PING
>sleep 240
>end
>
>This created some action on terminal and my session doesnt gets logged
>out. I want to convert this into alias
>
>could someone suggest me how to convert this into alias. I tried this
>
>alias infiniteping ' while(1) echo PING ; sleep 240 ; end ; '
>
>but it again prompts me for end.

However, here csh syntax gets hairy, and it is usually not worth the
trouble to figure out which combination of symbols is needed to get past
the problem. I suggest you do it like this:

alias infiniteping 'sh -c '"'"'while :;do echo PING ; sleep 240 ; done'"'"

You will find that although tcsh is a fine choice of an interactive
shell, that for programming, dropping back to Bourne/POSIX is a good
thing.

From: Maxwell Lol on
Teddy <neerajrathi2(a)gmail.com> writes:

> I use to write one while loop like this
>
> while(1)
> echo PING
> sleep 240
> end
>
> could someone suggest me how to convert this into alias.

Create a script, and call it with an alias.