10 More Discussions You Might Find Interesting
1. AIX
I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. I do not want to assign user the same group of that directories too.... (0 Replies)
Discussion started by: blinkingdan
0 Replies
2. Shell Programming and Scripting
Dear Members,
I have a list of xml files like
abc.xml.table
prq.xml.table
...
..
.
in a txt file.
Now I have to search the file(s) in all directories and sub-directories and print the full path of file in a output txt file.
Please help me with the script or command to do so.
... (11 Replies)
Discussion started by: Yoodit
11 Replies
3. UNIX for Dummies Questions & Answers
I am very new to unix as well as shell scripting.
I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file
Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies
4. Shell Programming and Scripting
Hi, I am a unix newbie.I need to write a shell script to move my oracle READ WRITE datafiles from one serevr to another. I need to move it from /u01/oradata/W1KK/.. to /u01/oradata/W2KK,
/u02/oradata/W1KK/.. to /u02/oradata/W2KK.
That is, I actaully am moving my datafiles from one database to... (2 Replies)
Discussion started by: mathews
2 Replies
5. Shell Programming and Scripting
Hi,
I am new to script and I want find one string from multiple files in diff directories and put that out put to new file.
Like I have A,B & C directories and each has multiple files but one file is unic in all the directories like COMM.txt
Now I want write script to find the string... (8 Replies)
Discussion started by: Mahessh123
8 Replies
6. Shell Programming and Scripting
Hello!!
I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory:
drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies
7. Shell Programming and Scripting
Hello, I have a directory www with multiple directories. Every directory has site name with .htm, .html, .php files or sub directories with .htm, .php, .html file as example
- www
- sitename 1
- site 1
- sitename 2
- sitename 3
What I'm looking for is a... (7 Replies)
Discussion started by: andyjill
7 Replies
8. Shell Programming and Scripting
Hi,
I have hundered's of files of the name
CMP_PORT_IN_P200903271623042437_20090328122430_err.xml in error directory of todays date ie 20090328 and in the file name 5th field specifies date only now i want to move all files of 20090328 to another directory i.e reprocess directory.
So... (3 Replies)
Discussion started by: ss_ss
3 Replies
9. Shell Programming and Scripting
Hello,
fjalkdsjfkldsajflkajdskl (3 Replies)
Discussion started by: pmeesara
3 Replies
10. Shell Programming and Scripting
Hi,
I'm quite new to scripting and need some help. I need to have one script that will check specific directories for files older than one month and then have the script delete them.
I have written the script below but it only does one directory. I don't quite know how to make it so it... (7 Replies)
Discussion started by: morgadoa
7 Replies
SPLIT(3) 1 SPLIT(3)
split - Split string into array by regular expression
SYNOPSIS
array split (string $pattern, string $string, [int $limit = -1])
DESCRIPTION
Splits a $string into array by regular expression.
Warning
This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.
PARAMETERS
o $pattern
- Case sensitive regular expression. If you want to split on any of the characters which are considered special by regular
expressions, you'll need to escape them first. If you think split(3) (or any other regex function, for that matter) is doing some-
thing weird, please read the file regex.7, included in the regex/ subdirectory of the PHP distribution. It's in manpage format, so
you'll want to do something along the lines of man /usr/local/src/regex/regex.7 in order to read it.
o $string
- The input string.
o $limit
- If $limit is set, the returned array will contain a maximum of $limit elements with the last element containing the whole rest
of $string.
RETURN VALUES
Returns an array of strings, each of which is a substring of $string formed by splitting it on boundaries formed by the case-sensitive
regular expression $pattern.
If there are n occurrences of $pattern, the returned array will contain n+1 items. For example, if there is no occurrence of $pattern, an
array with only one element will be returned. Of course, this is also true if $string is empty. If an error occurs, split(3) returns FALSE.
EXAMPLES
Example #1
split(3) example
To split off the first four fields from a line from /etc/passwd:
<?php
list($user, $pass, $uid, $gid, $extra) =
split(":", $passwd_line, 5);
?>
Example #2
split(3) example
To parse a date which may be delimited with slashes, dots, or hyphens:
<?php
// Delimiters may be slash, dot, or hyphen
$date = "04/30/1973";
list($month, $day, $year) = split('[/.-]', $date);
echo "Month: $month; Day: $day; Year: $year<br />
";
?>
NOTES
Note
As of PHP 5.3.0, the regex extension is deprecated in favor of the PCRE extension. Calling this function will issue an E_DEPRECATED
notice. See the list of differences for help on converting to PCRE.
Tip
split(3) is deprecated as of PHP 5.3.0. preg_split(3) is the suggested alternative to this function. If you don't require the power
of regular expressions, it is faster to use explode(3), which doesn't incur the overhead of the regular expression engine.
Tip
For users looking for a way to emulate Perl's @chars = split('', $str) behaviour, please see the examples for preg_split(3) or
str_split(3).
SEE ALSO
preg_split(3), spliti(3), str_split(3), explode(3), implode(3), chunk_split(3), wordwrap(3).
PHP Documentation Group SPLIT(3)