How to Amend Environmental Variables Using Command Line in Windows [closed] - windows

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am attempting to set up a small deployment that requires editing of system variables. I have used SETX in the past to create new variables and set values of existing ones. However, SETX does not appear to allow adding an existing string to a previously defined value.
For example, lets say I had a system variable FRED with value "BLA" and I wanted to add "FOO" such that the new value was "BLAFOO." It appears SETX does not allow me to set it by calling the value, %FRED% and then adding whatever I want at the end. This is what I have done when using temporary variables with the SET command.
Does anyone have any advice?

You really need to show us what you have tried and state step-by-step how you tested.
setx fred %fred%foo
will work BUT setx only sets the environment for FUTURE cmd invocations, not existing.
set fred=%fred%foo
setx fred %fred%
will set fred for the current and future, but not other cmd instances already started.

try this:
PATH
SETX PATH "c:\123;%path%;"
PATH
PAUSE
missing the double quotes maybe?

Related

What does cd * do in bash? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I saw someone use cd * and then use other commands like ls et al after that.
What does it do? Can someone explain it?
The shell expands * to an alphabetical list of the current directory's contents.
cd ignores all arguments after the first.
In lucky and/or extremely controlled circumstances, you can rely on the first item in the wildcard expansion to be the directory you want to cd into.
This may be marginally useful and/or entertaining if you have just created and descended into the current directory and populated it with a single subdirectory. I find it hard to imagine it could have other actual uses.
This command:
cd *
will only work if first list from current path is a directory since it expands to very first entry (file or directory) in the current path. You can see what comes first by doing echo *.
I would suggest not really relying on it since alphabetically first expansion can give you a file also like .bashrc or some other file name starting with dot.

What's the meaning of every part of a bash prompt? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
i'm very new to mac world, and i'm using bash doing some work.
But I'm not clear about the bash command line. It's so different from cmd.
yb_server:~ Aaron$
above is the command line when i start a terminal.
what's the meaning of yb_server?( I used to remember it's originally macintosh, why
it's changing to yb_server, how can i recover?)
what does ~ mean?
what does $ mean?
yb_server is your computer.
: is an arbitrary delimiter.
~ is your home directory (the current directory).
Aaron is you.
$ is "Speak to me, master!" But it is effectively an arbitrary delimiter.
The whole thing is your prompt. Google "bash prompt" for lots of info. Its format is totally up to you. Say echo $PS1 to find out what the format is now. The default is:
\h:\W \u\$
Learning what those symbols mean is left as an exercise for the reader!

Bash: tab completion selects by later part of file/directory name (like zsh)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Suppose I have these directories:
CSCI100
CSCI200
CSCI300
CSCI400
If I do
cd C<TAB>
it completes up to
cd CSCI
and then I must type a number to proceed.
Is there a way to do
cd 200<TAB>
which then alters the full command to
cd CSCI200
?
Bash's readline command "menu-complete" enables this behavior. You can either have this replace the Tab key's usual behavior (with the command bind "Tab: menu-complete", or by putting "Tab: menu-complete" in your .inputrc file), or choose a different keyboard shortcut for this function.
EDIT: Sorry, I misunderstood the question; it's about completing a suffix rather than a prefix of a filename. You can sort of do this with the default settings in bash if you use a wildcard and there's only one match for the pattern:
cd *200<TAB>
expands to:
cd CSCI200
If there's more than one match, it'll list matches if you TAB again. Binding TAB to menu-complete will make it cycle through matches instead. I don't know of any way to do this in bash without explicitly giving a wildcard to tell it where to do the expansion.

Identifying and adapting unix-"isms" to the Windows command prompt [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
In the Python Pyramid tutorial, I encountered this phrase:
"Windows users will need to adapt the Unix-isms below to match their environment."
It appears to relate to the "Export" command, but I am not entirely sure. The question therefore, is how do others go about this process of identifying and adapting "Unix-isms"? My only method so far is to see what isn't recognized, and obviously that could be due to different reasons.
Regarding research, I may have found a paywalled explanation for export specifically, but I'm sure there are better resources for adapting these commands.
Thank you!
The $ symbol is a Unix prompt
The ; is a command separator
export sets sets an environment variable, similar to setx
PATH=/path/to/tutorial_workspace/venv/bin:$PATH is modifying the PATH environment variable, similar to PATH=/path/to/tutorial_workspace/venv/bin;%PATH%
which searches the PATH for a program and returns its location.

unset path in windows [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
how can I remove enry from the PATH in windows, to set path I need to use SET PATH command but I can't find what do I need to do remove some entry from the path (UNSET PATH is not working), thanks in advance
P.S. from command line in windows
You can't remove an individual item from an environment variable. You have to read in the current value, parse it, remove what you want to remove, and then reset the variable.
If you aren't doing this in code then I can recommend Rapid Environment Editor as an excellent tool to make this work easy.

Resources