Hi
Since your sed does not support the -i option, we need to copy the sed output to a temporary file and then move the file contents to the original file:
Guru.
This User Gave Thanks to guruprasadpr For This Post:
Hi ,
I need to remove the 5th character of column1 and print the rest.
Can anybody give some advice?
Input:
0001c xx
0001r gg jj
0002y vv
0002p kk
0003q gg ll
0003v tt
0003t gg pp kk
Output:
0001 xx
0001 gg jj (9 Replies)
Hi I need to write a shell script which basically searches for all the empty files within the directory structure, lists them before asking the user to confirm if they would like to delete them. If the user deletes the file then a notice would appear confirming the file is deleted.
I've be... (5 Replies)
I have a text file with a few thousand lines in the format:
abcdef*ghijk*lmno
pqrs*tuv
wx*y*z
etc.
What I want to do is, get rid of everything after the SECOND asterik (the *) in each line (including the asterik). So for the example above, it would look like this after the editing:
... (11 Replies)
Hi
I am Trying to Write a script that can goto 4 different directorys on the server & remove the Files older then 30 days ??
/logs
logs1 logs2 logs3
Now I need to remove files under
logs1 logs2 logs3 which are older then 30 days whose name stat 'sit' , 'mig','bld' .
in... (3 Replies)
Hello,
I just saw that on my vps (centOS) my oscommerce with a seo script
has created millions of tmp files inside the /html/cache/ directory.
I would need to remove all those files (millions), I tried via shell but the vps
loads goes to very high and it hangs, is there some way to do a... (7 Replies)
Hi Team,
I have thousands of TIF files which are converted from PDF. Below is a sample of it.
LH9406_BLANCARAMOS_2012041812103210320001.tif
LH9406_BLANCARAMOS_2012041812103210320002.tif
LH9406_BLANCARAMOS_2012041812103210320003.tif
LH9411_ANGENIAHUTCHINSON_2012041812102510250001.tif... (9 Replies)
Hi Folks,
There is a job which generates a .zip files every day at /usr/app/generated directory , now please advise for the script that will delete this zip files permanently.but while deleting it should make sure that it will not delete the last two days recently generated zip files and this... (1 Reply)
Hi Guys,
I want to search for a specific file in a directory which have a "b" letter as the 3rd character in the name of the file.
For Example :
/abc/efg/ldbjfblkj.sh
/abc/efg/erublkd.sh
/abc/efg/eibueora.sh
/abc/efg/kfvnmnb.sh
Since we have 2 files with "b" as a 3rd character in... (5 Replies)
Hi
My directory structure is as below.
dir1, dir2, dir3
I have the list of files to be deleted in the below path as below.
/staging/retain_for_2years/Cleanup/log $ ls -lrt
total 0
drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2
drwxr-xr-x 2 root ... (2 Replies)
Hi,
I want a simple line of code that will compress files within a directory specified (parameter) and its subdirectories and also i want to remove files which are exactly 365 days old from the sysdate after this compression.
Please help.
Thanks,
JD (8 Replies)
Discussion started by: Jesshelle David
8 Replies
LEARN ABOUT PHP
sha1
SHA1(3) 1 SHA1(3)sha1 - Calculate the sha1 hash of a stringSYNOPSIS
string sha1 (string $str, [bool $raw_output = false])
DESCRIPTION
Calculates the sha1 hash of $str using the US Secure Hash Algorithm 1.
PARAMETERS
o $str
- The input string.
o $raw_output
- If the optional $raw_output is set to TRUE, then the sha1 digest is instead returned in raw binary format with a length of 20,
otherwise the returned value is a 40-character hexadecimal number.
RETURN VALUES
Returns the sha1 hash as a string.
EXAMPLES
Example #1
A sha1(3) example
<?php
$str = 'apple';
if (sha1($str) === 'd0be2dc421be4fcd0172e5afceea3970e2f3d940') {
echo "Would you like a green or red apple?";
}
?>
NOTES
Note
Secure password hashing
It is not recommended to use this function to secure passwords, due to the fast nature of this hashing algorithm. See here for
details.
SEE ALSO sha1_file(3), crc32(3), md5(3), hash(3), crypt(3), password_hash(3).
PHP Documentation Group SHA1(3)