How to use unicode characters in Windows command line?
Try: chcp 65001 which will change the code page to UTF-8. Also, you need to use Lucida console fonts.
Try: chcp 65001 which will change the code page to UTF-8. Also, you need to use Lucida console fonts.
& between two commands simply results in executing both commands independent on result of first command. The command right of & is executed after command left of & finished independent on success or error of the previous command, i.e. independent on exit / return value of previous command. && results in a conditional execution of … Read more
A lot of the answers here helped point me in the right direction, however none were suitable for me, so I am posting my solution. I have Windows 7, which comes with PowerShell built-in. Here is the script I used to find/replace all instances of text in a file: powershell -Command “(gc myFile.txt) -replace ‘foo’, … Read more
I was not aware of the award until today when some rookie tried to pin the UUOC on me for one of my answers. It was a cat file.txt | grep foo | cut … | cut …. I gave him a piece of my mind, and only after doing so visited the link he … Read more
In addition to backticks `command`, command substitution can be done with $(command) or “$(command)”, which I find easier to read, and allows for nesting. OUTPUT=$(ls -1) echo “${OUTPUT}” MULTILINE=$(ls \ -1) echo “${MULTILINE}” Quoting (“) does matter to preserve multi-line variable values; it is optional on the right-hand side of an assignment, as word splitting … Read more
How do I parse command line arguments in Bash?
Windows Server 2003 and later (i.e. anything after Windows XP 32 bit) provide the where.exe program which does some of what which does, though it matches all types of files, not just executable commands. (It does not match built-in shell commands like cd.) It will even accept wildcards, so where nt* finds all files in … Read more
The problem is that Xcode Command-line Tools needs to be updated. Solution #1 Go back to your terminal and enter: xcode-select –install You’ll then receive the following output: xcode-select: note: install requested for command line developer tools You will then be prompted in a window to update Xcode Command Line tools. (which may take a … Read more
scp -r [email protected]:/path/to/foo /home/user/Desktop/ By not including the trailing “https://stackoverflow.com/” at the end of foo, you will copy the directory itself (including contents), rather than only the contents of the directory. From man scp (See online manual) -r Recursively copy entire directories
How can I pretty-print JSON in a shell script?