cd returns - like every other command - an error level you can use: it is stored in the variable "$?", which is updated after every executed command.
A return value of "0" (also: logical TRUE) means success, while values between 1 and 254 (all of them meaning a logical FALSE) show various error conditions.
You can use this in scripts in the following two ways:
The second variant uses the logical meaning of non-zero being FALSE, the "&&" is a logical "OR": that way, if "command" returns "FALSE", the second command is executed, otherwise not.
I'm receiving an exit code 64 in our batch scheduler (BMC product control-m) executing a PERL script on UX-HP. Can you tell me where I can find a list of exit codes and their meaning. I'm assuming the exit code is from the Unix operating system not PERL. (3 Replies)
Hi , i have shell scripts that run the mysql directly by echoing and redirecting the output to the mysql logins. whenever the query executes successfully then the script runs fine and nothing has to be done there.
Now, when there is an error executing the query then it will generate the error... (8 Replies)
Our machines HP-UX 10.20 Ace, Attempting to run
various areas of SAM such as Backup and Restore, Printers and Plotters any areas of Time, etc give errors like the following:
unexpected exit: process /usr/sam/lbin/samx/ -C -p 1358 -s br_sa_bdevs
/usr/sam/lib///br.ui exited with a non-zero exit... (0 Replies)
Hi
when use "tar cpvzf /dev/st0 --exclude=/proc --exclude-/lost+found --exclude=/mnt --exclude=/media --exclude=/sys /" to tape,
get the following message "tar: error exit delayed form pervious error",
What is the mean ? Please suggest some solution for these errors. thx (1 Reply)
im running a while loop as a file watcher, with incremental counter on the retries..however when the retries reach it's limit i want it exit and echo and error and stop the batch. Im not sure the code i have will do that already...
Here is what i have that works:
#!/usr/bin/ksh
count=0... (2 Replies)
Hi guys
I would just like to know if aCC supports the command exit(0); in c++?
I am always getting the error below:
Error 328: "ac5.C", line 37 # Function 'exit' has not been defined yet; cannot call.
exit(0);
^^^^
Anyone had this problem?
Thanks! (2 Replies)
Hi,
I have a script ABC which calls another script XYZ. Function of XYZ is to ftp a file from one server to another.
code for ABC:
#!/bin/ksh
PATH=/usr/bin
home/user/xyz "$@"
exit $?
~
code for xyz:
#!/bin/ksh
HOSTNAME=$1
SRCNAME=$2
DSTNAME=$3 (4 Replies)
I have a script which connects to a remote server via FTP and gets some file from there.
#!/bin/bash
/usr/bin/ftp -n remote.hostname.com <<EOF
quote USER user123
quote PASS password123
lcd /dir1/dir2/dir3
cd /
mget file_pattern*
close
bye
EOF
rc=$?
if ]
... (7 Replies)
Hi,
I am using Jenkins and have integrated JMeter for testing. JMeter is generating a file with results properly using shell script. I have to validate the results and exit the shell with non-zero so my jenkins job gets failed. I tried multiple ways to grep the output file and read the results... (2 Replies)
Discussion started by: sitaram
2 Replies
LEARN ABOUT PHP
datefmt_is_lenient
DATEFMT_IS_LENIENT(3) 1 DATEFMT_IS_LENIENT(3)IntlDateFormatter::isLenient - Get the lenient used for the IntlDateFormatter
Object oriented style
SYNOPSIS
public bool IntlDateFormatter::isLenient (void )
DESCRIPTION
Procedural style
bool datefmt_is_lenient (IntlDateFormatter $fmt)
Check if the parser is strict or lenient in interpreting inputs that do not match the pattern exactly.
PARAMETERS
o $fmt
- The formatter resource.
RETURN VALUES
TRUE if parser is lenient, FALSE if parser is strict. By default the parser is lenient.
EXAMPLES
Example #1
datefmt_is_lenient(3) example
<?php
$fmt = datefmt_create(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN,
'dd/mm/yyyy'
);
echo 'lenient of the formatter is : ';
if ($fmt->isLenient()) {
echo 'TRUE';
} else {
echo 'FALSE';
}
datefmt_parse($fmt, '35/13/1971');
echo "
Trying to do parse('35/13/1971').
Result is : " . datefmt_parse($fmt, '35/13/1971');
if (intl_get_error_code() != 0) {
echo "
Error_msg is : " . intl_get_error_message();
echo "
Error_code is : " . intl_get_error_code();
}
datefmt_set_lenient($fmt,false);
echo 'Now lenient of the formatter is : ';
if ($fmt->isLenient()) {
echo 'TRUE';
} else {
echo 'FALSE';
}
datefmt_parse($fmt, '35/13/1971');
echo "
Trying to do parse('35/13/1971').Result is : " . datefmt_parse($fmt, '35/13/1971');
if (intl_get_error_code() != 0) {
echo "
Error_msg is : " . intl_get_error_message();
echo "
Error_code is : " . intl_get_error_code();
}
?>
Example #2
OO example
<?php
$fmt = new IntlDateFormatter(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN,
"dd/mm/yyyy"
);
echo "lenient of the formatter is : ";
if ($fmt->isLenient()) {
echo 'TRUE';
} else {
echo 'FALSE';
}
$fmt->parse('35/13/1971');
echo "
Trying to do parse('35/13/1971').
Result is : " . $fmt->parse('35/13/1971');
if (intl_get_error_code() != 0){
echo "
Error_msg is : " . intl_get_error_message();
echo "
Error_code is : " . intl_get_error_code();
}
$fmt->setLenient(FALSE);
echo 'Now lenient of the formatter is : ';
if ($fmt->isLenient()) {
echo 'TRUE';
} else {
echo 'FALSE';
}
$fmt->parse('35/13/1971');
echo "
Trying to do parse('35/13/1971').
Result is : " . $fmt->parse('35/13/1971');
if (intl_get_error_code() != 0) {
echo "
Error_msg is : " . intl_get_error_message();
echo "
Error_code is : " . intl_get_error_code();
}
?>
The above example will output:
lenient of the formatter is : TRUE
Trying to do parse('35/13/1971').
Result is : -2147483
Now lenient of the formatter is : FALSE
Trying to do parse('35/13/1971').
Result is :
Error_msg is : Date parsing failed: U_PARSE_ERROR
Error_code is : 9
SEE ALSO datefmt_set_lenient(3), datefmt_create(3).
PHP Documentation Group DATEFMT_IS_LENIENT(3)