package Psh
::Builtins
::Fg
;
=item * C<fg [%JOB|COMMAND]>
Bring a job into the foreground. If JOB is omitted, uses the
highest-numbered stopped job, or, failing that, the highest-numbered job.
JOB may either be a job number or a command. If you specify a command
it will launch a new program (this is for consisteny with the bg command)
if( ! Psh
::OS
::has_job_control
()) {
Psh
::Util
::print_error_i18n
('no_jobcontrol');
if (!defined($arg) || $arg eq '') {
($arg)= Psh
::Joblist
::find_job
();
return Psh
::evl
($arg.' &');
($arg)= Psh
::Joblist
::find_last_with_name
($arg,0);
return (0,undef) unless defined($arg);
Psh
::OS
::restart_job
(1, $arg );