All,
I would like to run a cgi script in cygwin which i have installed in WinXP.
My CYGWIN directory structure is
/var/www/
drwxrwx---+ 2 user Users 0 Nov 23 16:24 cgi-bin
drwxrwx---+ 3 user Users 0 Oct 22 17:21 htdocs
drwxrwx---+ 3 user Users 0 Oct 22 17:22 icons
and another... (1 Reply)
Hi, all,
I try to run a quite simple bash script mytest.sh in cygwin, it's content is:
#!/bin/bash
echo "It is my first bash shell"
there are three lines in the script. The second line is blank line.
When I run it use command: bash c:/mytest.sh, ... (6 Replies)
hi,
i have a script that runs on bash and would like to run it on a machine that has csh and bash. the default setting on that machine is csh. i dont want to change my code to run it with a csh shell. is there any way i can run the script (written in bash) on this machine? in other words is there... (3 Replies)
I ran into this issue and thanks to various postings in various forums, was
able to figure out the solution but didn't see one posting that laid the
whole issue out cleanly. So thought the following might help others ...
------------------------------------------------------------------------... (2 Replies)
Hello everyone,
I am struggling a bit with a batch script that I need to run in cygwin. I work in winXP and I had to write some awk scripts to do some file manipulation, and now I would like to automate the process by just running a batch file so that my colleagues can use it easily.
Now, the... (2 Replies)
I'd like to streamline the code more than a bit to get it to run faster.
There's a thread about this and related issues of mine on the Cygwin mailing-list, but I want to eliminate any chances it might just be inefficient/inelegant/crappy code. A previous run of the same script on both Cygwin and... (6 Replies)
Hmmm.... I love these forums because I always get great prompt responses and I want to ask a question about running bash on windows. Is that allowed?
Now I know I can install cygwin cron and run bash that way.
Can I run bash from windows schedule task? How?
thanks
siegfried (1 Reply)
As stated, I am looking into keeping my backup drive unmounted in normal windows use. Partly this is to address threats like cryptolocker. Since one of my backup drives is an internal drive, it will not likely afford any protection from such a threat. I am thinking of adding code to my rsync script... (5 Replies)
Hi everybody,
First, I'm sorry for my bad english!
I have the following situation:
I have a Windows 2012 R2 with Cygwin installed. The Windows Server is used as a backup Server with Dell AppAssure installed. At the moment, AppAssure saves Backup Targets to a repository on his D. The... (9 Replies)
I am trying to use a batch file to automatically execute a bash script with no luck this far.
The batch script looks like this:
C:\Cygwin64\bin\bash test.sh
I have also tried this:
C:\Cygwin64\bin\bash "C:\Cygwin64\bin\test.sh"
Needless to say that the windows box has Cygwin... (7 Replies)
Discussion started by: Xterra
7 Replies
LEARN ABOUT PHP
dirname
DIRNAME(3) 1 DIRNAME(3)dirname - Returns parent directory's pathSYNOPSIS
string dirname (string $path)
DESCRIPTION
Given a string containing the path of a file or directory, this function will return the parent directory's path.
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 ( /).
RETURN VALUES
Returns the path of the parent directory. If there are no slashes in $path, a dot (' .') is returned, indicating the current directory.
Otherwise, the returned string is $path with any trailing /component removed.
CHANGELOG
+--------+-------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+-------------------------------+
| 5.0.0 | |
| | |
| | dirname(3) is now binary safe |
| | |
+--------+-------------------------------+
EXAMPLES
Example #1
dirname(3) example
<?php
echo "1) " . dirname("/etc/passwd") . PHP_EOL; // 1) /etc
echo "2) " . dirname("/etc/") . PHP_EOL; // 2) / (or on Windows)
echo "3) " . dirname("."); // 3) .
?>
NOTES
Note
dirname(3) operates naively on the input string, and is not aware of the actual filesystem, or path components such as " ..".
Note
dirname(3) is locale aware, so for it to see the correct directory name with multibyte character paths, the matching locale must be
set using the setlocale(3) function.
Note
Since PHP 4.3.0, you will often get a slash or a dot back from dirname(3) in situations where the older functionality would have
given you the empty string.
Check the following change example:
<?php
//before PHP 4.3.0
dirname('c:/'); // returned '.'
//after PHP 4.3.0
dirname('c:/x'); // returns 'c:'
dirname('c:/Temp/x'); // returns 'c:/Temp'
dirname('/x'); // returns ''
?>
SEE ALSO basename(3), pathinfo(3), realpath(3).
PHP Documentation Group DIRNAME(3)