abspath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
Tag Archive for path
Find absolute path of Bash script
getting current filename physical path
<!--- Get expanded path of the BASE path. ---> <cfset strPath = ExpandPath( "./" ) /> <!--- Get the expanded path of the CURRENT template path. ---> <cfset strPath = GetDirectoryFromPath( GetCurrentTemplatePath()) />
Set Linux environment variables JAVA_HOME & PATH globally using /etc/profile
export JAVA_HOME=/usr/lib/jvm/default-java/jre export PATH=$JAVA_HOME/bin:$PATH
get absolute server path
$serverPath = dirname(__FILE__); include($serverPath . "/includes/someFile.php");
Filtering the Find command
find . ! -name "*constants.sass" ! -path "*landing_page*" -name "*sass"
AS Flash Lite1.1 MCã®ãƒ€ã‚¤ãƒŠãƒŸãƒƒã‚¯ãƒ†ã‚ストã«ãƒ†ã‚ストをé€ã‚‹
// root以下ã«box_mcã‚’é…ç½®ã—ã¦ã€ãã®ä¸ã«å¤‰æ•°=numdisplayã®ãƒ€ã‚¤ãƒŠãƒŸãƒƒã‚¯ãƒ†ã‚ストをé…ç½®
tellTarget("/box_mc"){
numdisplay = /:collectionLabel add ": " add /:currentImage;
}
Parse html via RegularExpression and place results in Array
using System.Text.RegularExpressions;
//looking for photo paths with REGX-a
string nl = // in this case page html.
MatchCollection mc = null;
string sRegExp = "src=(?:"|')?(?<imgSrc>[^>]*[^/].(?:jpg|bmp|gif|png))(?:"|')?";
mc = Regex.Matches(nl, sRegExp);
string[] path;
for (int j = 0; j < mc.Count; j++)
{
path = mc[j].Value.Split('"');
Response.Write(path[1].ToString().Trim() + "<br />");
}
Get the full URL of current document
// Returns the full URL of the current document.
function getCurrentUrl()
{
// Checks scheme.
$url = ($_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
// Checks port.
$url .= ($_SERVER['SERVER_PORT'] != '80') ? $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$_SERVER['REQUEST_URI'] : $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
// Returns full URL.
return $url;
}
Getting Full URL/Path with ASP
function GetPath()
query_string = request.ServerVariables("QUERY_STRING")
if query_string <> "" then
query_string = "?" & query_string
end if
GetPath = "http://" & request.ServerVariables("SERVER_NAME") & request.ServerVariables("URL") & query_string
end function