path-variables

How do I manipulate $PATH elements in shell scripts?

≡放荡痞女 提交于 2019-11-27 02:53:02
Is there a idiomatic way of removing elements from PATH-like shell variables? That is I want to take PATH=/home/joe/bin:/usr/local/bin:/usr/bin:/bin:/path/to/app/bin:. and remove or replace the /path/to/app/bin without clobbering the rest of the variable. Extra points for allowing me put new elements in arbitrary positions. The target will be recognizable by a well defined string, and may occur at any point in the list. I know I've seen this done, and can probably cobble something together on my own, but I'm looking for a nice approach. Portability and standardization a plus. I use bash, but

Spring MVC: how to indicate whether a path variable is required or not?

好久不见. 提交于 2019-11-27 01:28:00
问题 I am doing a Spring web. For a controller method, I am able to use RequestParam to indicate whether a parameter it is required or not. For example: @RequestMapping({"customer"}) public String surveys(HttpServletRequest request, @RequestParam(value="id", required = false) Long id, Map<String, Object> map) I would like to use PathVariable such as the following: @RequestMapping({"customer/{id}"}) public String surveys(HttpServletRequest request, @PathVariable("id") Long id, Map<String, Object>

Error in setting JAVA_HOME

放肆的年华 提交于 2019-11-26 16:41:18
问题 I have recently downloaded Maven and followed the instructions given on this this page. I already have ant installed on my machine. Now, if I want to verify that Maven is installed perfectly or not it is giving me error that JAVA_HOME is not set correctly, but same works perfectly fine for ANT. For Maven I tried : 1. open cmd 2. type mvn -version 3. Error appeared : C:\Users\Admin>mvn -version ERROR: JAVA_HOME is set to an invalid directory. JAVA_HOME = "C:\Program Files\Java\jre7\bin" Please

How to set JAVA_HOME in Linux for all users

跟風遠走 提交于 2019-11-26 11:33:27
I am new to Linux system and there seem to be too many Java folders. java -version gives me: java version "1.7.0_55" OpenJDK Runtime Environment (rhel-2.4.7.1.el6_5-x86_64 u55-b13) OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode) When I am trying to build a Maven project , I am getting error: Error: JAVA_HOME is not defined correctly. We cannot execute /usr/java/jdk1.7.0_05/bin/java Could you please tell me which files I need to modify for root as well as not-root user and where exactly is java located? That Dave Guy find /usr/lib/jvm/java-1.x.x-openjdk vim /etc/profile Prepend sudo if

python is not recognized as an internal or external command

非 Y 不嫁゛ 提交于 2019-11-26 10:00:39
问题 I try to install this software. For that Python is required. I installed Python from here of name python-2.7.3.msi . I am working on Windows 7. Hierarchy of my Python software is same as in this post. After doing that, I make PATHVALUE = C:\\Python27\\Scripts When I run any Python file, it shows python is not recognized as an internal or external command, operable program or batch file. Failed to create vc project files. How can I resolve this? 回答1: You want to append to your PATH the string

How do I manipulate $PATH elements in shell scripts?

纵饮孤独 提交于 2019-11-26 09:17:52
问题 Is there a idiomatic way of removing elements from PATH-like shell variables? That is I want to take PATH=/home/joe/bin:/usr/local/bin:/usr/bin:/bin:/path/to/app/bin:. and remove or replace the /path/to/app/bin without clobbering the rest of the variable. Extra points for allowing me put new elements in arbitrary positions. The target will be recognizable by a well defined string, and may occur at any point in the list. I know I\'ve seen this done, and can probably cobble something together

How to keep from duplicating path variable in csh

人走茶凉 提交于 2019-11-26 07:37:46
问题 It is typical to have something like this in your cshrc file for setting the path: set path = ( . $otherpath $path ) but, the path gets duplicated when you source your cshrc file multiple times, how do you prevent the duplication? EDIT: This is one unclean way of doing it: set localpaths = ( . $otherpaths ) echo ${path} | egrep -i \"$localpaths\" >& /dev/null if ($status != 0) then set path = ( . $otherpaths $path ) endif 回答1: you can use the following Perl script to prune paths of duplicates

Passing an Array or List to @Pathvariable - Spring/Java

半世苍凉 提交于 2019-11-26 07:27:29
问题 I am doing a simple \'get\' in JBoss/Spring. I want the client to pass me an array of integers in the url. How do I set that up on the server? And show should the client send the message? This is what I have right now. @RequestMapping(value=\"/test/{firstNameIds}\", method=RequestMethod.GET) @ResponseBody public String test(@PathVariable List<Integer> firstNameIds) { //What do I do?? return \"Dummy\"; } On the client I would like to pass something like http://localhost:8080/public/test/[1,3,4

How to set JAVA_HOME in Linux for all users

走远了吗. 提交于 2019-11-26 02:27:25
问题 I am new to Linux system and there seem to be too many Java folders. java -version gives me: java version \"1.7.0_55\" OpenJDK Runtime Environment (rhel-2.4.7.1.el6_5-x86_64 u55-b13) OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode) When I am trying to build a Maven project , I am getting error: Error: JAVA_HOME is not defined correctly. We cannot execute /usr/java/jdk1.7.0_05/bin/java Could you please tell me which files I need to modify for root as well as not-root user and where

Is there an equivalent of &#39;which&#39; on the Windows command line?

感情迁移 提交于 2019-11-25 21:56:38
问题 As I sometimes have path problems, where one of my own cmd scripts is hidden (shadowed) by another program (earlier on the path), I would like to be able to find the full path to a program on the Windows command line, given just its name. Is there an equivalent to the UNIX command \'which\'? On UNIX, which command prints the full path of the given command to easily find and repair these shadowing problems. 回答1: Windows Server 2003 and later (i.e. anything after Windows XP 32 bit) provide the