From 67a28ec801e5a24cb1fae0daaad719639c6bfcf4 Mon Sep 17 00:00:00 2001 From: mrshnra Date: Sat, 10 Oct 2015 10:58:12 +0330 Subject: [PATCH 1/2] Update exc01.sh --- exc01.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/exc01.sh b/exc01.sh index 7146b72..4ace9e1 100755 --- a/exc01.sh +++ b/exc01.sh @@ -3,3 +3,10 @@ # Then runs a sleep command for each CPU on the background. +nproc + +for core in $(nproc) +do +taskset -c $((core-1)) sleep 10 +done + From 52ec9cc67c3d1262c9e0385078443513653c7013 Mon Sep 17 00:00:00 2001 From: mrshnra Date: Sat, 10 Oct 2015 12:22:16 +0330 Subject: [PATCH 2/2] Update exc02.sh --- exc02.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exc02.sh b/exc02.sh index 26b48eb..d80e456 100755 --- a/exc02.sh +++ b/exc02.sh @@ -2,4 +2,8 @@ # Write an script that accepts a file name and a number as its parameter, # Then return the content of that line number in that file. - +echo -n "Enter the file name" +read name +echo -n "Enter a number" +read number +sed -n ''$number' p' $name