Add a few c++ aliases, and make .bash_profile cross-distro
David Blume

David Blume commited on 2016-02-29 06:53:12
Showing 2 changed files, with 14 additions and 6 deletions.

... ...
@@ -1,12 +1,16 @@
1 1
 # ~/.bash_profile: executed by bash for login shells.
2 2
 
3
-# source the system wide bashrc if it exists
4
-if [ -e /etc/bash.bashrc ] ; then
5
-  source /etc/bash.bashrc
3
+# Source global definitions
4
+if [ -f /etc/bashrc ]; then
5
+    # Macintosh (Darwin) and Fedora / Red Hat
6
+    . /etc/bashrc
7
+elif [ -f /etc/bash.bashrc ]; then
8
+    # Raspberry Pi / Debian and Cygwin
9
+    . /etc/bash.bashrc
6 10
 fi
7 11
 
8
-# source the users bashrc if it exists
9
-if [ -e "${HOME}/.bashrc" ] ; then
12
+# source the user's bashrc if it exists
13
+if [ -f "${HOME}/.bashrc" ]; then
10 14
     source "${HOME}/.bashrc"
11 15
 fi
12 16
 
... ...
@@ -41,5 +41,9 @@ export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quo
41 41
 # Add to PATH only if not already in PATH.
42 42
 add_to_path $HOME/bin
43 43
 
44
-alias findinchppfiles="find . -type f \( -name \*.[ch]pp -or -name \*.[ch] \) -print0 | xargs -0 grep -nI"
45 44
 alias findinpyfiles="find . -name \*.py -print0 | xargs -0 grep -nI"
45
+alias findinchppfiles="find . -type f \( -name \*.[ch]pp -or -name \*.[ch] \) -print0 | xargs -0 grep -nI"
46
+alias findincppfiles="find . -type f \( -name \*.cpp -or -name \*.c \) -print0 | xargs -0 grep -nI"
47
+alias findinhppfiles="find . -type f \( -name \*.hpp -or -name \*.h \) -print0 | xargs -0 grep -nI"
48
+
49
+alias clip="expand | cut -b1-\$COLUMNS"
46 50