path

How to set current working directory to the directory of the script?

℡╲_俬逩灬. 提交于 2019-12-17 03:44:44
问题 I'm writing a bash script. I need the current working directory to always be the directory that the script is located in. The default behavior is that the current working directory in the script is that of the shell from which I run it, but I do not want this behavior. 回答1: #!/bin/bash cd "$(dirname "$0")" 回答2: The following also works: cd "${0%/*}" The syntax is thoroughly described in this StackOverflow answer. 回答3: Try the following simple one-liners: For all UNIX/OSX/Linux dir=$(cd -P --

How to create multiple output paths in Webpack config

假如想象 提交于 2019-12-17 03:22:16
问题 Does anyone know how to create multiple output paths in a webpack.config.js file? I'm using bootstrap-sass which comes with a few different font files, etc. For webpack to process these i've included file-loader which is working correctly, however the files it outputs are being saved to the output path i specified for the rest of my files: output: { path: __dirname + "/js", filename: "scripts.min.js" } I'd like to achieve something where I can maybe look at the extension types for whatever

How to create multiple output paths in Webpack config

落爺英雄遲暮 提交于 2019-12-17 03:22:10
问题 Does anyone know how to create multiple output paths in a webpack.config.js file? I'm using bootstrap-sass which comes with a few different font files, etc. For webpack to process these i've included file-loader which is working correctly, however the files it outputs are being saved to the output path i specified for the rest of my files: output: { path: __dirname + "/js", filename: "scripts.min.js" } I'd like to achieve something where I can maybe look at the extension types for whatever

Get absolute path of initially run script

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 03:21:11
问题 I have searched high and low and get a lot of different solutions and variables containing info to get the absolute path. But they seem to work under some conditions and not under others. Is there one silver bullet way to get the absolute path of the executed script in PHP? For me, the script will run from the command line, but, a solution should function just as well if run within Apache etc. Clarification: The initially executed script, not necessarily the file where the solution is coded.

PHP Fatal Error Failed opening required File

孤人 提交于 2019-12-17 03:09:31
问题 I am getting the following error from Apache [Sat Mar 19 23:10:50 2011] [warn] mod_fcgid: stderr: PHP Fatal error: require_once() [function.require]: Failed opening required '/common/configs/config_templates.inc.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/viapics1/public_html/common/configs/config.inc.php on line 158 I am definately not an expert of Apache but the file config.inc.php & config_templates.inc.php are there. I also tried navigating to a test.html page I placed

PHP Fatal Error Failed opening required File

夙愿已清 提交于 2019-12-17 03:09:10
问题 I am getting the following error from Apache [Sat Mar 19 23:10:50 2011] [warn] mod_fcgid: stderr: PHP Fatal error: require_once() [function.require]: Failed opening required '/common/configs/config_templates.inc.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/viapics1/public_html/common/configs/config.inc.php on line 158 I am definately not an expert of Apache but the file config.inc.php & config_templates.inc.php are there. I also tried navigating to a test.html page I placed

How to override the path of PHP to use the MAMP path?

偶尔善良 提交于 2019-12-17 02:52:35
问题 After screwing up entirely my PHP configuration on MAC trying to get the SOAP module working (-bash: /usr/bin/php: No such file or directory ....) I now have to use MAMP but each time I have to type the path Applications/MAMP/bin/php5.3/bin/php to do command line. How to just type php instead the entire path on MAC ? I double checked and i do not have a file named .profile nor bash_profile Thanks PS: Here's what output echo $PATH : echo $PATH /Applications/MAMP/Library/bin/:/Applications/MAMP

Windows 7 - Add Path

*爱你&永不变心* 提交于 2019-12-17 02:23:23
问题 I need to add a new path (sumatraPDF) on my PATH variable . I don't know why it does not work... I think everything is right but when I try to execute sumatrapdf.exe from CMD it cannot find the program. This is what I did: The path is correct, I checked it 1000 times. The idea is use LaTeX with sublimetext and when I save a .text file sumatra has to open and show to me the result. If I want that I have to add the path of SumatraPDF... but it does not work. 回答1: I think you are editing

How to combine paths in Java?

本小妞迷上赌 提交于 2019-12-17 02:07:17
问题 Is there a Java equivalent for System.IO.Path.Combine() in C#/.NET? Or any code to accomplish this? This static method combines one or more strings into a path. 回答1: Rather than keeping everything string-based, you should use a class which is designed to represent a file system path. If you're using Java 7 or Java 8, you should strongly consider using java.nio.file.Path; Path.resolve can be used to combine one path with another, or with a string. The Paths helper class is useful too. For

Unrecognized escape sequence for path string containing backslashes

纵然是瞬间 提交于 2019-12-16 22:46:47
问题 The following code generates a compiler error about an "unrecognized escape sequence" for each backslash: string foo = "D:\Projects\Some\Kind\Of\Pathproblem\wuhoo.xml"; I guess I need to escape backslash? How do I do that? 回答1: You can either use a double backslash each time string foo = "D:\\Projects\\Some\\Kind\\Of\\Pathproblem\\wuhoo.xml"; or use the @ symbol string foo = @"D:\Projects\Some\Kind\Of\Pathproblem\wuhoo.xml"; 回答2: Try this: string foo = @"D:\Projects\Some\Kind\Of\Pathproblem