pip broken after upgrading

One reason can be remembed locations. You can clear the cached locations by issuing following command: hash -r SIDENOTE: Instead of which, using type command, you can see the hashed location: $ type pip pip is /usr/local/bin/pip $ pip -V pip 1.5.6 from /usr/local/lib/python2.7/dist-packages (python 2.7) $ type pip pip is hashed (/usr/local/bin/pip)

Evaluating variables in a string in bash

Let’s take things step by step: When you do this: mycmd=’cat $myfile’ You prevent the shell from interpolating $myfile. Thus: $ echo $mycmd cat $myfile If you want to allow the interpolation, you can use double quotes: $ mycmd=”echo $myfile” #Double quotes! $ echo “$mycmd” cat afile.txt This, of course, freezes the interpretation of $mycmd … Read more

Shell script change directory with variable

You variable contains a carriage return. Try saying: cd $(echo $RED_INSTANCE_NAME | tr -d ‘\r’) and it should work. In order to remove the CR from the variable you can say: RED_INSTANCE_NAME=$(echo $RED_INSTANCE_NAME | tr -d ‘\r’) The following would illustrate the issue: $ mkdir abc $ foo=abc$’\r’ $ echo “${foo}” abc $ cd “${foo}” … Read more

How can I highlight the warning and error lines in the make output?

Have a look at colormake, found here $ apt-cache search colormake colormake – simple wrapper around make to colorize output Using the power of google, I also found this bash-function. make() { pathpat=”(/[^/]*)+:[0-9]+” ccred=$(echo -e “\033[0;31m”) ccyellow=$(echo -e “\033[0;33m”) ccend=$(echo -e “\033[0m”) /usr/bin/make “$@” 2>&1 | sed -E -e “/[Ee]rror[: ]/ s%$pathpat%$ccred&$ccend%g” -e “/[Ww]arning[: ]/ … Read more

Error for convert command in command line

You can also make it with help of Homebrew – which is quite nice and popular package manager To Install homeBrew past in your terminal ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” To install imagemagick past in the terminal brew install imagemagick

How to conditionally add flags to shell scripts?

#!/bin/bash /usr/local/bin/mongo-connector \ -m “$MONGO_HOST” \ -t “$NEO_URI” \ ${VERBOSE:+-v} \ -stdout If VERBOSE is set and non-empty, then ${VERBOSE:+-v} evaluates to -v. If VERBOSE is unset or empty, it evaluates to the empty string. Note that this is an instance where you must avoid using double quotes. If you write: cmd “${VERBOSE:+-v}” rather than … Read more