Sponsored Content
Full Discussion: detecting corrupted file
Top Forums Shell Programming and Scripting detecting corrupted file Post 40897 by Perderabo on Wednesday 24th of September 2003 09:52:20 PM
Old 09-24-2003
By the way, this should work....
Code:
if cat somefile > /dev/null 2>&1 ; then
         echo file is ok
else
          echo file is corrupt
fi

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

corrupted tar file

Hi all, I've got a corrupted tar file with some filename being like ?a=n is it possible to get them repaired? (1 Reply)
Discussion started by: klintsovi
1 Replies

2. HP-UX

passwd file corrupted

Good Day Our HP box was hacked and the passwd file has been altered,there are only 2 user accounts active,and these dont have any administrative rights.I need to edit the passwd file to correct the su and root entries. Does any body have any suggestions as to how i can do this with out the root... (10 Replies)
Discussion started by: cantona7
10 Replies

3. UNIX for Dummies Questions & Answers

Help! passwd file corrupted

Hi, I am new to UNIX, and have recently installed Suse 9.3. I have been experimenting with all of the commands and have somehow managed to modify the default shell of the root user to an invalid file. Consequently I cannot su to the root user as I receive the 'no such file or directory' error... (2 Replies)
Discussion started by: Tony Montana
2 Replies

4. HP-UX

Could be a corrupted file?

Hello! Do you know the meaning of... "crw-rw---- 1 informix informix 64 0x020001 Jan 21 2004 rifxroot" I don't know what the first "c" means. Furthermor, if I try to copy this file (rifxroot) it appears a message: "cp: cannot open rifxroot: No such device or address" I don't... (1 Reply)
Discussion started by: kaugrs
1 Replies

5. UNIX for Dummies Questions & Answers

may a corrupted .gz file be repaired?

Preparing for a move to a new server, I needed to offload about somewhat over a gigabyte of newsfeeds that my website collects, and that I had been saving on the server. I tarred them and zipped them into about a dozen smaller files of about 150Mb each. All seemed well. I downloaded them onto my... (3 Replies)
Discussion started by: JohnTinker
3 Replies

6. Solaris

root mail file corrupted

Hi, We were facing cron job failures and raised a case to our UNIX team, they fixed the issue and said cron job failures due to root mail file corruption. My questions are, 1. Whether root mail file corruption cause cron job failures? 2. Do we have any size limitation for root mail file?... (0 Replies)
Discussion started by: paventhan
0 Replies

7. Solaris

WTMPX File corrupted

Hi All I work on solaris 8, 9 and 10 platforms and have encountered an error which is my wtmpx files appear to be corrupted as all entries contain the date 1970 (the birth of unix). Now this is obviously not the case, so my query is: 1 - Can the existing wtmpx files be manipulated to... (6 Replies)
Discussion started by: drestarr96
6 Replies

8. Linux

Corrupted daemon.log file

hi, yesterday I made something wrong and deleted daemon.log file. Then created a new file with the same name under the same path but now, it seems that file constructed has been corrupted . In earlier times, it was including regex name. Now there is no regex name. This is the current... (0 Replies)
Discussion started by: baris35
0 Replies

9. Red Hat

.bash_profile file corrupted

Hi, Unexpectedly i entered wrong entries in .bash_profile for my user which has administrative permissions. So, i am getting errors for every command. I dont have backup file also, so any body can help me how to recover it. Regards, Mastan (7 Replies)
Discussion started by: mastansaheb
7 Replies

10. UNIX for Dummies Questions & Answers

After Ftp'ing file to destination how to check the file if it is in correct ASCII and not corrupted

Hi Folks, While transferring file from FTP software like Filezilla the files gets corrupted. Is there any way I can check if the recently transferred file is in ASCII and not corrupted. I have tried using file -i filename command which does tell if the file character set is ASCII or binary... (6 Replies)
Discussion started by: Khan28
6 Replies
DEFINE(3)								 1								 DEFINE(3)

define - Defines a named constant

SYNOPSIS
bool define (string $name, mixed $value, [bool $case_insensitive = false]) DESCRIPTION
Defines a named constant at runtime. PARAMETERS
o $name - The name of the constant. o $value - The value of the constant; only scalar and null values are allowed. As of PHP 7 it also possible to use array value. Scalar val- ues are integer, float, string or boolean values. It is possible to define resource constants, however it is not recommended and may cause unpredictable behavior. o $case_insensitive - If set to TRUE, the constant will be defined case-insensitive. The default behavior is case-sensitive; i.e. CONSTANT and Con- stant represent different values. Note Case-insensitive constants are stored as lower-case. RETURN VALUES
Returns TRUE on success or FALSE on failure. CHANGELOG
+--------+---------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------+ | 7.0.0 | | | | | | | | | | array values are allowed. | | | | +--------+---------------------------+ EXAMPLES
Example #1 Defining Constants <?php define("CONSTANT", "Hello world."); echo CONSTANT; // outputs "Hello world." echo Constant; // outputs "Constant" and issues a notice. define("GREETING", "Hello you.", true); echo GREETING; // outputs "Hello you." echo Greeting; // outputs "Hello you." // Works as of PHP 7 define('ANIMALS', array( 'dog', 'cat', 'bird' )); echo ANIMALS[1]; // outputs "cat" ?> SEE ALSO
defined(3), constant(3), The section on Constants. PHP Documentation Group DEFINE(3)
All times are GMT -4. The time now is 06:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy