My system uses UTC for the system clock, which I don't particularly feel like changing. Is there an easy way to get the current TAI time? (preferably a command line tool or flag)
JanKanis's questions
I want to configure a local apache server to serve php files with different php versions. In my document root I have phpinfo.php
, now if I go to http://localhost/phpinfo.php4
, I want to see the phpinfo.php file processed with php4, if I go to http://localhost/phpinfo.php5
I want to see the same file processed with php5.
Note: both php 4 and 5 are already installed side by side, I have no problem configuring apache to treat files that have a .php4
or .php5
extension on the filesystem with the correct php version. What I want is for apache to do the following:
- If the url-path ends in
.php5
, serve the file which has a.php
extension on the filesystem using theapplication/x-httpd-php5
handler. - If the url-path ends in
.php4
, serve the same file with the.php
extension on the filesystem using theapplication/x-httpd-php4
handler.
Is there a portable unix shellscripting way of joining a number of strings together with a given separator, like so:
$ strjoin --- foo bar baz quux
foo---bar---baz---quux
Sure I could use a $scripting_language one liner or an ugly explicit loop in a shellscript function, but the unix hackers of old probably had some need for this as well, so someone has made a standard command like this that I don't know about somewhere in the past, right?
edit
The sed
method is certainly the easiest one in many situations, but it doesn't work if the strings can contain spaces. And many of the other answers also don't handle that. Are there any solutions other than the $IFS
trick that handle spaces (and all possible characters in general) and do not require writing a full loop?