02-05-2009
my script has two echoes.....
echo "hello" > [path of file]
echo "world" >> [path of file]
10 More Discussions You Might Find Interesting
1. Solaris
am unable to open a .log file which is 4MB size. (18 Replies)
Discussion started by: venkatramana
18 Replies
2. HP-UX
Hello,
I am New to Unix.
I am Using HP-UX 9000 Series for my Application.
I am Currently Facing an Issue that the error messages are being written in the syslog file instead of the Application Log File. The Codes for that Syslog.h is written in Pro*C.
I want to know how to Redirect these... (3 Replies)
Discussion started by: balasubramaniam
3 Replies
3. Linux
Hi I am trying to send a file form one linux server into an another linux server.
I cannot do ftp get. Can anyone please assist me how can I push the file to the other server ?
Thanks. (2 Replies)
Discussion started by: sureshcisco
2 Replies
4. Shell Programming and Scripting
I am looking for a script to do the following. I have a large log file that contains hundreds of warnings, a lot of which can be ignored. The tool doesn't allow me to suppress it, so I like to parse it out from the log file and isolate just the new messages/warnings, based on an exception file.
... (12 Replies)
Discussion started by: cdn2008
12 Replies
5. Shell Programming and Scripting
NEWBIE ALERT!
Hi,
I'm 1 month into learning Perl and done reading "Minimal Perl" by Tim Maher (which I enjoyed enoumously). I'm not a programmer by profession but want to use Perl to automate various tasks at my job. I have a problem (obviously) and are looking for your much appreciated help.... (0 Replies)
Discussion started by: jospan
0 Replies
6. Shell Programming and Scripting
Hi All,
Below is my code,what I am trying to do is redirecting output of ftp to a log file & then greping the errors but here I am unable to grep "Permission denied" error only & also the corresponding log file is also not getting created.
#!/bin/sh
. cfg
USER='abc'
PASSWD='abc123'
... (4 Replies)
Discussion started by: ss_ss
4 Replies
7. Shell Programming and Scripting
Can we capture and write all the error messages which were being displayed on the command prompt screen during execution of a program into a log file?
If yes, can anyone please let me know on how to do it?
I am using ksh and working on AIX server.
Thank you in advance. (4 Replies)
Discussion started by: vpv0002
4 Replies
8. Shell Programming and Scripting
Hi,
My log file has error messages, universal no and universal ID. The problem is i have to search Universal ID from the error messages. But the log file write error messages with universal no and error messages in one line. and universal no with universal ID in other line. So i write two loops... (5 Replies)
Discussion started by: pjlotiya
5 Replies
9. Shell Programming and Scripting
Hi,
I am trying to attach a .log file or .txt file to mail command to send an email once my ksh script executed. I am unable to use mutt command as it has been not installed and i am not supposed to install it. I have tried many ways by googling which has not helped me to succeed.
Here is my... (5 Replies)
Discussion started by: Samah
5 Replies
10. Shell Programming and Scripting
I have been searching and reading about syslog. I would like to know how to Transfer the logs being thrown into /var/log/messages into another file example /var/log/volumelog.
tail -f /var/log/messages
dblogger: msg_to_dbrow: no logtype using missing
dblogger: msg_to_dbrow_str: val ==... (2 Replies)
Discussion started by: kenshinhimura
2 Replies
PATHINFO(3) 1 PATHINFO(3)
pathinfo - Returns information about a file path
SYNOPSIS
mixed pathinfo (string $path, [int $options = PATHINFO_DIRNAME | PATHINFO_BASENAME | PATHINFO_EXTENSION | PATHINFO_FILENAME])
DESCRIPTION
pathinfo(3) returns information about $path: either an associative array or a string, depending on $options.
PARAMETERS
o $path
- The path to be parsed.
o $options
- If present, specifies a specific element to be returned; one of PATHINFO_DIRNAME, PATHINFO_BASENAME, PATHINFO_EXTENSION or
PATHINFO_FILENAME. If $options is not specified, returns all available elements.
RETURN VALUES
If the $options parameter is not passed, an associative array containing the following elements is returned: dirname, basename, extension
(if any), and filename.
Note
If the $path has more than one extension, PATHINFO_EXTENSION returns only the last one and PATHINFO_FILENAME only strips the last
one. (see first example below).
Note
If the $path does not have an extension, no extension element will be returned (see second example below).
If $options is present, returns a string containing the requested element.
CHANGELOG
+--------+--------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+--------------------------------------------+
| 5.2.0 | |
| | |
| | The PATHINFO_FILENAME constant was added. |
| | |
+--------+--------------------------------------------+
EXAMPLES
Example #1
pathinfo(3) Example
<?php
$path_parts = pathinfo('/www/htdocs/inc/lib.inc.php');
echo $path_parts['dirname'], "
";
echo $path_parts['basename'], "
";
echo $path_parts['extension'], "
";
echo $path_parts['filename'], "
"; // since PHP 5.2.0
?>
The above example will output:
/www/htdocs/inc
lib.inc.php
php
lib.inc
Example #2
pathinfo(3) example showing difference between null and no extension
<?php
$path_parts = pathinfo('/path/emptyextension.');
var_dump($path_parts['extension']);
$path_parts = pathinfo('/path/noextension');
var_dump($path_parts['extension']);
?>
The above example will output something similar to:
string(0) ""
Notice: Undefined index: extension in test.php on line 6
NULL
NOTES
Note
For information on retrieving the current path info, read the section on predefined reserved variables.
Note
pathinfo(3) is locale aware, so for it to parse a path containing multibyte characters correctly, the matching locale must be set
using the setlocale(3) function.
SEE ALSO
dirname(3), basename(3), parse_url(3), realpath(3).
PHP Documentation Group PATHINFO(3)