How to add path with space in Bash variable
mount /dev/sda9 “$games” As mentioned, always quote variable dereferences. Otherwise, the shell confuses the spaces in the variable’s value as spaces separating multiple values.
mount /dev/sda9 “$games” As mentioned, always quote variable dereferences. Otherwise, the shell confuses the spaces in the variable’s value as spaces separating multiple values.
A friend pointed me towards tput(1), and I cooked up this solution: #!/bin/sh # ack-wrapper – use tput to try and detect whether the terminal is # color-capable, and call ack-grep accordingly. OPTION=’–nocolor’ COLORS=$(tput colors 2> /dev/null) if [ $? = 0 ] && [ $COLORS -gt 2 ]; then OPTION=” fi exec ack-grep $OPTION … Read more
I found the answer here. Basically gnuplot needs to be reinstalled as: brew reinstall gnuplot –with-x11 This page also helps with troubleshooting Octave installation on Mavericks.
In the settings.json file we need to have the following “terminal.integrated.profiles.windows”: { “PowerShell”: { “source”: “PowerShell”, “icon”: “terminal-powershell” }, “Command Prompt”: { “path”: [ “${env:windir}\\Sysnative\\cmd.exe”, “${env:windir}\\System32\\cmd.exe” ], “args”: [], “icon”: “terminal-cmd” }, “Git Bash”: { “source”: “Git Bash” } }, And set the default terminal by adding “terminal.integrated.defaultProfile.windows”: “Command Prompt”, We can achieve this by … Read more
Printing the Environment from the Shell As other answers have pointed out, one can use /usr/bin/env or /usr/bin/printenv from the command line to see what the environment is in the shell before starting Rails, or in a subshell after starting it. For example: rails s RETURN CTRL-Z env RETURN fg RETURN Displaying ENV from the … Read more
Update: scapy-python3 is deprecated (2018) and will no longer be updated. scapy>=2.4.0 has merged python 3 compatibility. The most up-to-date installation method is now pip3 install scapy>=2.4.0 You may check the installation page in the documentation for other installation methods Original answer: Perhaps you are trying to install the package scapy for Python 2, but … Read more
On Linux there are mutiple options The typical used one is touch touch bar.txt However you may also use echo if you want to create and write to the file right away The following command tells to create bar.txt and put foo inside of it echo foo > bar.txt You may also use >> which … Read more
What about the shorter : #!/bin/bash [[ $1 == A ]] && echo “A” || echo “not A” ? And a beginner version (identical logic) : #!/bin/bash if [[ $1 == A ]]; then echo “A” else echo “not A” fi Like Scott said, you have a syntax error (missing space). explanations I use boolean … Read more
Old question, I know, but as an alternative solution I just discovered powerlevel9k, an extension of agnoster (they appear practically identical bar a fair few tweaks), which has this functionality built in. Just set it as your zsh theme, then in .zshrc set POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 which ensures that only two directories are listed. Alternate options are … Read more
According to the man page of ag -G –file-search-regex PATTERN Only search files whose names match PATTERN. You can use the -G option to perform searches on files matching a pattern. So, to answer your question: root@apache107:~/rpm-4.12.0.1# ag -G cpio.c size rpm2cpio.c 21: off_t payload_size; 73: /* Retrieve payload size and compression type. */ 76: … Read more