Posts

Showing posts with the label command-line

How to set environment variables with spaces?

How to set environment variables with spaces? I need to set values to a environmental variable using a batch file. I wrote the script for this: @echo off set value="Hello world" setx -M srijani "%srijani%;%value%" It gives the error: ERROR: Invalid syntax. Default option is not allowed more than '2' time(s). Type "SETX /?" for usage. I googled and found that while using white spaces we need to write it inside a double quotes. set value="Hello world" But, that is not working too. Note: I am on Windows 7. what are the values of %srijani% and %value% variables. – npocmaka Dec 18 '15 at 10:35 %srijani% %value% Standard mistake often made is using set variable="value" instead of set "variable=value" . See for example Why is no string output wit...

How to check the checksum through commandline?

How to check the checksum through commandline? I want to do something like this on commandline on my UNIX variant if (shasum httpd-2.4.7.tar.bz2 == 19asdasdasd56462e44d61a093ea57e964cf0af05c0e) echo 'good to go' I dont want to write a separate script text page just to check this. This above thing is showing syntax error. But there must be a slick way to get around this? How to do this? 8 Answers 8 shasum httpd-2.4.7.tar.bz2 | awk '$1=="19asdasdasd56462e44d61a093ea57e964cf0af05c0e"{print"good to go"}' So normally you get this output from shasum What my command does it is takes the first field $1 , and compares it against your string. If the strings match, then awk prints "good to go". $1 "good to go" dude – John Doe Feb 22 '14 at 16:58 ...