darth
May 31, 2026, 8:11pm
1
Livestream date: 2026-06-07
Weight 4
Key knowledge areas
Use standard sh syntax (loops, tests).
Use command substitution.
Test return values for success or failure or other information provided by a command.
Execute chained commands.
Perform conditional mailing to the superuser.
Correctly select the script interpreter through the shebang (#!) line.
Manage the location, ownership, execution and suid-rights of scripts.
darth
June 8, 2026, 4:45pm
2
Homework 1
How could all of the script’s command line arguments be used to initialize a Bash array?
darth
June 8, 2026, 4:46pm
3
Homework 2
Why is it that, counter intuitively, the command test 1 > 2 evaluates as true?
darth
June 8, 2026, 4:46pm
4
Homework 3
How would a user temporarily change the default field separator to the newline character only,
while still being able to revert it to its original content?
iceblade92:
dont know XD i gues array = ($1, $2, $3, etc)
Well, that will work but what if you have more arguments?
There’s a way to specify them all at once.
iceblade92:
just type IFS=‘.’ to revert it
That will make . a separator which is not what you want. How can we restore the previous value of IFS?
iceblade92:
think we can do array = ( $@) so it will use all arguments even if we dont designate the amount of arguments
Yep, just a tiny little improvement: use quotes around $@ so that arguments with spaces work as expected.
But the answer is correct.
iceblade92:
unset IFS then bash will start spliting as default
True.
You could also save previous IFS value to a variable and restore it afterwards.