From bc7c991ea267958a76a641d412f2c31437f3fe62 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hypki Date: Mon, 15 May 2023 14:42:46 +0200 Subject: [PATCH] 'Backup;' --- args-reversed.sh | 11 +++++++++++ tabledata/ex1.sh | 4 ++-- tabledata/screenshare | 1 - 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 args-reversed.sh delete mode 100644 tabledata/screenshare diff --git a/args-reversed.sh b/args-reversed.sh new file mode 100644 index 0000000..89aa224 --- /dev/null +++ b/args-reversed.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +if [ $# -eq 0 ]; then exit 1; fi + +for ((i=$#;i>0;i--)) +do + eval echo -n " \$$i " + echo -n " " +done + +echo \ No newline at end of file diff --git a/tabledata/ex1.sh b/tabledata/ex1.sh index 588322b..800591c 100755 --- a/tabledata/ex1.sh +++ b/tabledata/ex1.sh @@ -1,6 +1,6 @@ #!/bin/bash # iterating line-by-line over the input file -numOfPeople=`cat $1 | grep 'Poland' | wc -l` +numOfPeople=`cat $1 | grep "$2" | wc -l` -echo "Num. of people from Poland is $numOfPeople" +echo "Num. of people from $2 is $numOfPeople" diff --git a/tabledata/screenshare b/tabledata/screenshare deleted file mode 100644 index 029b907..0000000 --- a/tabledata/screenshare +++ /dev/null @@ -1 +0,0 @@ -https://meet.jit.si/unixsysop