summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2018-11-16 13:57:07 +0000
committerIan C <ianc@noddybox.co.uk>2018-11-16 13:57:07 +0000
commit975754ba15088168d33f5801dd3393644a350553 (patch)
tree6b4df2d529c33940335e20652df249b77de8b0aa
parent10280a648f9caa1836f9b461301467194d091787 (diff)
Added strlen. Updated .bashrc and aliases to use vim for vi and added home bin.
-rw-r--r--dotrc/.bash_aliases2
-rw-r--r--dotrc/.bashrc4
-rw-r--r--strlen.c17
3 files changed, 23 insertions, 0 deletions
diff --git a/dotrc/.bash_aliases b/dotrc/.bash_aliases
index d499ae1..ddb9651 100644
--- a/dotrc/.bash_aliases
+++ b/dotrc/.bash_aliases
@@ -2,6 +2,7 @@ export EDITOR=vim
export VISUAL=vim
alias V="vi"
+alias vi=vim
alias ctags="ctags --langmap=c:.c.pc"
@@ -14,6 +15,7 @@ alias pss="ps -ef"
alias psu="ps -f -u $LOGNAME"
alias h="history"
alias p="pwd"
+alias start=cygstart
alias wenv="env | egrep "
diff --git a/dotrc/.bashrc b/dotrc/.bashrc
index 3dc35e6..20eeedd 100644
--- a/dotrc/.bashrc
+++ b/dotrc/.bashrc
@@ -3,3 +3,7 @@ if [ "$PS1" != "" ] ; then
fi
test -s $HOME/.bash_aliases && . ~/.bash_aliases
+
+if [ ! "$(echo $PATH | fgrep $HOME/bin)" ] ; then
+ export PATH=$HOME/bin:$PATH
+fi
diff --git a/strlen.c b/strlen.c
new file mode 100644
index 0000000..a7fead6
--- /dev/null
+++ b/strlen.c
@@ -0,0 +1,17 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+int main(int argc, char *argv[])
+{
+ int f;
+ int len;
+
+ for(f = 1; argv[f]; f++)
+ {
+ len = strlen(argv[f]);
+ printf("strlen(%s) = %d\n", argv[f], len);
+ }
+
+ return EXIT_SUCCESS;
+}