From 5d42b00c105128d1821210eab713fef7f8879902 Mon Sep 17 00:00:00 2001 From: Jack-Benny Persson Date: Sun, 15 Dec 2013 11:14:16 +0100 Subject: [PATCH] Created a folder for Misc stuff and rewritten README files in english --- Misc/README.md | 3 +++ Misc/count_args.sh | 16 ++++++++++++++++ jack.sh => Misc/jack.sh | 0 push.sh => Misc/push.sh | 0 Misc/shifty_stuff.sh | 12 ++++++++++++ README.md | 4 ++-- 6 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 Misc/README.md create mode 100755 Misc/count_args.sh rename jack.sh => Misc/jack.sh (100%) rename push.sh => Misc/push.sh (100%) create mode 100755 Misc/shifty_stuff.sh diff --git a/Misc/README.md b/Misc/README.md new file mode 100644 index 0000000..b1f3335 --- /dev/null +++ b/Misc/README.md @@ -0,0 +1,3 @@ +# Misc # + +Here I'll put my misc tests and experiments. For example testing out loops, new features I've found in book, or simply just scripts I've made for the fun of it. diff --git a/Misc/count_args.sh b/Misc/count_args.sh new file mode 100755 index 0000000..36ebdcf --- /dev/null +++ b/Misc/count_args.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Jack-Benny Persson +# LX 13 +# Test to count arguments to a script + +echo "You entered $# arguments" +echo "The last argument was ${!#}" +echo "The arguments entered was: $*" + +echo "Iterating throuh all the arguments: " +for i in $@; do + echo "$i" +done + +exit 0 diff --git a/jack.sh b/Misc/jack.sh similarity index 100% rename from jack.sh rename to Misc/jack.sh diff --git a/push.sh b/Misc/push.sh similarity index 100% rename from push.sh rename to Misc/push.sh diff --git a/Misc/shifty_stuff.sh b/Misc/shifty_stuff.sh new file mode 100755 index 0000000..fe9e58e --- /dev/null +++ b/Misc/shifty_stuff.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Jack-Benny Persson +# LX13 +# Testing out shift + +while [ -n "$1" ]; do + echo $1 + shift +done + +exit 0 diff --git a/README.md b/README.md index 8c3ed3b..42f7b11 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# Mina script till kursen # +# Scripts for the scripting course # -Här sparar jag mina övningar m.m. +Here I'll save my misc scripts for the Bash scripting course