I have written a little script to scan users home directories for certain commands located inside a file. The script is setup to include a small help section and allows for passing a username argument to override scanning of all users home directories.
A lot of searching and trial and error has went into this script on my part. I would appreciate it if some of you that actually know what you're doing can take a look at it for me. If you could give me some pointers, ideas, or suggestions I would be grateful.
Hi,
I want to copy all the log file except current date log from one server to another server.
Log File will be like this LOGNIG_08_11_2008*.log
For this
cd /test/log
date -d '1 day ago' "+%d_%m_%Y" -->This command gives previous day
scp LOGSNIG_date -d '1 day ago' "+%d_%m_%Y"... (2 Replies)
Hi guys,
I 've been brewing this shellscript, but I can't test it until next tuesday.
In the meantime I am too curious wether it will work or not, so I'd like to hear your comments.
Background:
I want to watch the user quota for mailboxes in various email-domains on a IMAP-server.
I have... (1 Reply)
Hi,
I need Unix Shell Script Review Check list in the format of word or excel.
Can any one provide the review checklist for unix shell script. Pls. (1 Reply)
I have written a bit of shell that lets our company check all our SSL certs.
the aim is to have a list of servers and run this check from cron once a week.
Our managers have decided that we will not run BASH, so it has been written in /bin/sh and only needs openssl, no perl, no bash, no extra... (8 Replies)
Hello
Im new to this forums, I would like some help regarding a script that I need in order to copy some files. Heres the scenario:
I need to search several files which have a particular code inside, lets say "test" all of them on different directories. I need to copy all of them on a new... (4 Replies)
HI everyone,
I been to this site before for help and found my answers on other threads now I am posting my own :).
I have a list of file names with out extensions on an txt file. I need a way for the script to search on the server for each file name and copy the files over to a new directory.... (12 Replies)
The script distributes files from an AIX server using iether ftp or sftp depending on the constraint of the destination server. I am interested in having the error checking routine critically reviewed. I will only include an excerpt from the script concerning error trapping: (where $FTP_OUT is the... (7 Replies)
Hello *nix friends,
I've written a shell script that allow web admin's to copy file/folder from a development site to the production site. It's more or less a poor man SVN.
I'm posting the script here because I was able to get many questions answered through this forum and also, I want to... (4 Replies)
Discussion started by: rwhite35
4 Replies
LEARN ABOUT PHP
basename
BASENAME(3) 1 BASENAME(3)basename - Returns trailing name component of pathSYNOPSIS
string basename (string $path, [string $suffix])
DESCRIPTION
Given a string containing the path to a file or directory, this function will return the trailing name component.
PARAMETERS
o $path
- A path. On Windows, both slash ( /) and backslash ( ) are used as directory separator character. In other environments, it is
the forward slash ( /).
o $suffix
- If the name component ends in $suffix this will also be cut off.
RETURN VALUES
Returns the base name of the given $path.
EXAMPLES
Example #1
basename(3) example
<?php
echo "1) ".basename("/etc/sudoers.d", ".d").PHP_EOL;
echo "2) ".basename("/etc/sudoers.d").PHP_EOL;
echo "3) ".basename("/etc/passwd").PHP_EOL;
echo "4) ".basename("/etc/").PHP_EOL;
echo "5) ".basename(".").PHP_EOL;
echo "6) ".basename("/");
?>
The above example will output:
1) sudoers
2) sudoers.d
3) passwd
4) etc
5) .
6)
NOTES
Note
basename(3) operates naively on the input string, and is not aware of the actual filesystem, or path components such as " ..".
Note
basename(3) is locale aware, so for it to see the correct basename with multibyte character paths, the matching locale must be set
using the setlocale(3) function.
SEE ALSO dirname(3), pathinfo(3).
PHP Documentation Group BASENAME(3)