Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Newbie question about csh

66 views
Skip to first unread message

Andrew

unread,
Jun 1, 2007, 8:38:26 PM6/1/07
to
Hi to all!

I'm movig my first steps in FreeBSD and its default shell. I usually have to
launch long-time processes, such 'make' commands, using csh through SSH
(PuTTY) client sessions.
I know it's possible to suspend a process (Ctrl+Z) to let it run in the
background and let me issue new commands without needing to open new login
sessions, but I need the process running in the background even after I
disconnect, as I use to do over a remote desktop connection to administer
MSFT servers. Is it possible here to do that? I suppose I'll have to
"de-associate" the process from the terminal I launched it from...

TIA

Andrew


Bill Marcum

unread,
Jun 2, 2007, 12:14:17 AM6/2/07
to
man nohup
man screen

--
Serfs up!
-- Spartacus

Andrew Smallshaw

unread,
Jun 5, 2007, 3:32:44 PM6/5/07
to
On 2007-06-02, Andrew <and...@example.com> wrote:

> I know it's possible to suspend a process (Ctrl+Z) to let it run in the
> background and let me issue new commands without needing to open new login
> sessions, but I need the process running in the background even after I
> disconnect, as I use to do over a remote desktop connection to administer
> MSFT servers. Is it possible here to do that? I suppose I'll have to
> "de-associate" the process from the terminal I launched it from...

nohup command ... &

AFAIK there's no way to retro-fit this to a command started
interactively and then suspended with job control.

--
Andrew Smallshaw
and...@sdf.lonestar.org

Andrew

unread,
Jun 7, 2007, 9:13:05 AM6/7/07
to
"Andrew Smallshaw" <and...@sdf.lonestar.org> wrote in message
news:slrnf6bein....@sdf.lonestar.org...

Thanks you Andrew. But if I would absolutely need such a feature, can I have
it by using other remote control protocols... maybe the X window system?


Andrew
and...@live.labn.com


Kenny McCormack

unread,
Jun 7, 2007, 1:25:11 PM6/7/07
to
In article <4668046f$0$21212$5fc...@news.tiscali.it>,

I think we've lost our way on this thread (check thread title).

One of the nice things about the csh shells is that, unlike the sh
shells, nohup is the default. I.e., if you do: sleep 32767 & exit
the process stays running. This makes nohup unnecessary.

So, if you do:

% sleep 32767
(wait awhile, realize you've got better things to do, press ^Z)
% bg;exit

your problem is solved. The point being that the 'bg' command makes it
just as if you had started it with '&' in the first place.

Alan Curry

unread,
Jun 7, 2007, 2:52:29 PM6/7/07
to
In article <slrnf6bein....@sdf.lonestar.org>,

The "disown" builtin, present at least in zsh and bash.

--
Alan Curry
pac...@world.std.com

Kenny McCormack

unread,
Jun 7, 2007, 5:51:21 PM6/7/07
to
In article <f49k5d$jon$1...@pcls6.std.com>,

What part of: Re: Newbie question about *csh* (emphasis mine, Ed.)
is messing you up?

Patrick

unread,
Jun 7, 2007, 6:40:25 PM6/7/07
to
In news:f49ukp$soj$1...@news.xmission.com,
Kenny McCormack <gaz...@xmission.xmission.com> wrote:

>>> nohup command ... &
>>>
>>> AFAIK there's no way to retro-fit this to a command started
>>> interactively and then suspended with job control.
>>
>> The "disown" builtin, present at least in zsh and bash.
>
> What part of: Re: Newbie question about *csh* (emphasis mine, Ed.)
> is messing you up?

For starters, why anyone in a sane state of mind would use csh.

Andrew

unread,
Jun 8, 2007, 5:45:07 AM6/8/07
to
"Kenny McCormack" <gaz...@xmission.xmission.com> wrote in message
news:f49f1n$orh$1...@news.xmission.com...

> In article <4668046f$0$21212$5fc...@news.tiscali.it>,
> Andrew <and...@live.labn.com> wrote:
>>>
>>>> I know it's possible to suspend a process (Ctrl+Z) to let it run in
>>>> the
>>>> background and let me issue new commands without needing to open new
>>>> login
>>>> sessions, but I need the process running in the background even after I
>>>> disconnect, as I use to do over a remote desktop connection to
>>>> administer
>>>> MSFT servers. Is it possible here to do that? I suppose I'll have to
>>>> "de-associate" the process from the terminal I launched it from...
>>>
>
> I think we've lost our way on this thread (check thread title).
>
> One of the nice things about the csh shells is that, unlike the sh
> shells, nohup is the default. I.e., if you do: sleep 32767 & exit
> the process stays running. This makes nohup unnecessary.
>
> So, if you do:
>
> % sleep 32767
> (wait awhile, realize you've got better things to do, press ^Z)
> % bg;exit
>
> your problem is solved. The point being that the 'bg' command makes it
> just as if you had started it with '&' in the first place.
>

You are great!! Thanks you very much Kenny... and now, one more question: it
would be possible to make that process running in foreground when I come
back in a new terminal?


Andrew
and...@live.labn.com


Kenny McCormack

unread,
Jun 8, 2007, 12:14:03 PM6/8/07
to
In article <4669252b$0$16032$5fc...@news.tiscali.it>,
Andrew <and...@live.labn.com> wrote:
...
>You are great!!

Well, thank you. That makes two of us.

>Thanks you very much Kenny... and now, one more question: it
>would be possible to make that process running in foreground when I come
>back in a new terminal?

Unforunately, no. Once the process is detached (by virtue of the one
shell that had any control over it having exited), you can't get back to
it.

It sounds like you want something like 'screen' (highly recommended -
once you get used to it, you'll not be able to imagine life without it).
Or, if you really need a full-blown GUI type environment (like you have
under DOS/Windows with PC Anywhere, et al), look into VNC, which allows
you to create and access a "floating" X session.

Kenny McCormack

unread,
Jun 8, 2007, 12:16:33 PM6/8/07
to
In article <5crfrdF...@mid.individual.net>,

As I've just demonstrated, as an interactive environment, tcsh is
superior to any of the "sh-ish" shells.

(Of course, no argument that as a scripting language, csh is just plain
weird - but that's not what we're talking about here)

Maxwell Lol

unread,
Jun 8, 2007, 12:50:08 PM6/8/07
to
gaz...@xmission.xmission.com (Kenny McCormack) writes:

> >For starters, why anyone in a sane state of mind would use csh.
>
> As I've just demonstrated, as an interactive environment, tcsh is
> superior to any of the "sh-ish" shells.

And the authors of the anti-csh diatribes both admit to using csh for
interactive use (at least in the past... :-).

Chris F.A. Johnson

unread,
Jun 8, 2007, 1:27:31 PM6/8/07
to

How did you think they reached their conclusions? _Of course_ it
was largely from experience.

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell/>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence

Andrew

unread,
Jun 8, 2007, 3:42:51 PM6/8/07
to
"Kenny McCormack" <gaz...@xmission.xmission.com> wrote in message
news:f4bv8b$uhc$2...@news.xmission.com...

> In article <4669252b$0$16032$5fc...@news.tiscali.it>,
> Andrew <and...@live.labn.com> wrote:
> ...
>
> It sounds like you want something like 'screen' (highly recommended -
> once you get used to it, you'll not be able to imagine life without it).
> Or, if you really need a full-blown GUI type environment (like you have
> under DOS/Windows with PC Anywhere, et al), look into VNC, which allows
> you to create and access a "floating" X session.
>

Wow!! It seems exactly what I was looking for: thanks you very much.
I have a lot to learn about Unix administration, but I think it is a good
investment, expecially because of what I'm seeing in the development of MSFT
technologies and products... and I know what I mean, since I am a MCSA, MCSE
and MCT! :)

Thanks you again, and I hope to come back quickly with more difficult
questions! ;)


Andrew
and...@live.labn.com


Barry Margolin

unread,
Jun 8, 2007, 11:34:32 PM6/8/07
to
In article <35goj4-...@206-248-139-163.dsl.teksavvy.com>,

"Chris F.A. Johnson" <cfajo...@gmail.com> wrote:

> On 2007-06-08, Maxwell Lol wrote:
> > gaz...@xmission.xmission.com (Kenny McCormack) writes:
> >
> >> >For starters, why anyone in a sane state of mind would use csh.
> >>
> >> As I've just demonstrated, as an interactive environment, tcsh is
> >> superior to any of the "sh-ish" shells.
> >
> > And the authors of the anti-csh diatribes both admit to using csh for
> > interactive use (at least in the past... :-).
>
> How did you think they reached their conclusions? _Of course_ it
> was largely from experience.

I think the point he was making is that the anti-csh diatribes mainly
say that csh should not be used FOR SCRIPTING. They admit that tcsh is
an acceptable interactive shell, and many of them still use it.

I was one of them for many years. It wasn't until I got Mac OS X, which
uses bash as the default shell, that I finally switched. It's taken me
a few years, but I've finally stopped trying to type "foreach". :)

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

0 new messages