Skip to Content
Using csh & tcsh
book

Using csh & tcsh

by Paul DuBois
July 1995
Beginner to intermediate
244 pages
5h 58m
English
O'Reilly Media, Inc.
Content preview from Using csh & tcsh

Changing a Job's State

A job can be moved from one state (foreground, background, or suspended) to any other state. The commands used to manipulate jobs are listed in Table 15-1; %j designates the job on which you wish to operate. fg, bg, kill, and stop can take multiple job specifier arguments, each of which is processed in turn. Table 15-2 shows the various forms that %j can take.

Table 15-1. Job Control Commands

Command

Effect of Command

CTRL–Z

Stop the foreground job

CTRL–C

Interrupt (terminate) foreground job

fg %j

Bring stopped or background job to foreground

bg %j

Move stopped job to background

kill %j

Kill (terminate) stopped or background job

stop %j

Stop background job

suspend

Suspend current shell (if non-login shell)

jobs

Display current job list

Table 15-2. Job Specifiers

Specifier

Job to Which the Specifier Refers

%

Current job (%+ and %% are synonyms for %)

%–

Previous job

%n

Job number n

%str

Job whose command line begins with str

%?str

Job whose command line contains str

You can often refer to a job more easily by name than by number, although %str and %?str are ambiguous if they match more than one job in your job list. When such a situation occurs, the shell provides warning. For example, our job list includes two jobs beginning with vi and two jobs containing reference.ms. As a result, the following commands are ambiguous:

% fg %vi
%vi: Ambiguous.
% fg %?ref
%?ref: Ambiguous.

If you use %?str to refer to a job and the shell responds with No match, the shell is interpreting the ? as a pattern-matching ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Linux Shells by Example

Linux Shells by Example

Ellie Quigley

Publisher Resources

ISBN: 9781449377526Errata Page