Hi,
I have a TEST.dat file. As a clean up process, I have to delete the TEST.dat file if it is empty. Basically, I don't want to delete TEST.dat if it contains anything in it but want to delete TEST.dat if it contains any spaces or nothing in it.
Is there a command to check if the file... (2 Replies)
hi
how can I determine, if a file is empty or not?I am using read line clause.
The script should be like:
while read line
do
if(file is empty) then;
......
done < $blacklist (1 Reply)
I have a program that takes a file in which I use a sed to remove some data that is not needed. If all of the data is removed. I want to grep for that in the file and print that there is no data left in the file. When I use sed, I replace a word with nothing but it still seems to leave a return... (5 Replies)
Hi All,
I have a piece of perl code in which I DON'T want to delete a file rather empty out the contents, here is the code -
if ( unlink("$opt_b") == 1 ) {
print_log( "$opt_b deleted", 1 );
}else {
print_log( "Could not delete $opt_b:$!", 1 );
... (5 Replies)
Hi there,
I'm just starting out with shell scripting and I'm trying to make a test where the script will basically run yum check-update to find out if the server has any available and if it does it e-mails me but if not it will just stop there.
I have it working if there are actually... (7 Replies)
when I run the following command in AIX (bash),
find ./*
I get the following error.
find: bad status-- ./*
Thats becasuse, its an empty directory. The same works, when there the directory is not empty. Even though the find deesnt have to rerun any result.
My full find command would look... (4 Replies)
Discussion started by: deepakwins
4 Replies
LEARN ABOUT PHP
msgfmt_get_error_code
MSGFMT_GET_ERROR_CODE(3) 1 MSGFMT_GET_ERROR_CODE(3)MessageFormatter::getErrorCode - Get the error code from last operation
Object oriented style
SYNOPSIS
public int MessageFormatter::getErrorCode (void )
DESCRIPTION
Procedural style
int msgfmt_get_error_code (MessageFormatter $fmt)
Get the error code from last operation.
PARAMETERS
o $fmt
- The message formatter
RETURN VALUES
The error code, one of UErrorCode values. Initial value is U_ZERO_ERROR.
EXAMPLES
Example #1
msgfmt_get_error_code(3) example
<?php
$fmt = msgfmt_create("en_US", "{0, number} monkeys on {1, number} trees");
$str = msgfmt_format($fmt, array());
if(!$str) {
echo "ERROR: ".msgfmt_get_error_message($fmt) . " (" . msgfmt_get_error_code($fmt) . ")
";
}
?>
Example #2
OO example
<?php
$fmt = new MessageFormatter("en_US", "{0, number} monkeys on {1, number} trees");
$str = $fmt->format(array());
if(!$str) {
echo "ERROR: ".$fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")
";
}
?>
The above example will output:
ERROR: msgfmt_format: not enough parameters: U_ILLEGAL_ARGUMENT_ERROR (1)
SEE ALSO msgfmt_get_error_message(3), intl_get_error_code(3), intl_is_failure(3).
PHP Documentation Group MSGFMT_GET_ERROR_CODE(3)