Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows equivalent of $export

Tags:

windows

I am trying to follow some instructions for creating a directory using the command line. The instructions are:

$ export PROJ_HOME=$HOME/proj/111 $ export PROJECT_BASEDIR=PROJ_HOME/exercises/ex1 $ mkdir -p $PROJ_HOME 

Are these windows commands? Are there windows equivalents?

like image 881
user1154644 Avatar asked Sep 09 '13 15:09

user1154644


People also ask

How do I echo environment variables in Windows?

To reference a variable in Windows, use %varname% (with prefix and suffix of '%' ). For example, you can use the echo command to print the value of a variable in the form " echo %varname% ".

What is the Windows equivalent of Which?

The where command is a Windows which equivalent in a command-line prompt (CMD). In a Windows PowerShell the alternative for the which command is the Get-Command utility.


1 Answers

To translate your *nix style command script to windows/command batch style it would go like this:

SET PROJ_HOME=%USERPROFILE%/proj/111 SET PROJECT_BASEDIR=%PROJ_HOME%/exercises/ex1 mkdir "%PROJ_HOME%" 

mkdir on windows doens't have a -p parameter : from the MKDIR /? help:

MKDIR creates any intermediate directories in the path, if needed.

which basically is what mkdir -p (or --parents for purists) on *nix does, as taken from the man guide

like image 59
rene Avatar answered Oct 20 '22 13:10

rene