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 + 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