Bash Scripting

Class length: 18 weeks. Start anytime.

Creator: kday

Status: Established

Assignment 1: Problem set 1

Do all of the examples throughout Chapter 4 in Bash Cookbook by O'Reilly.

To submit the homework, just leave a comment saying that you completed it and mention any problems you had or any cool things you learned. Don't print out your whole session history, it gets really long really fast. Do post code specific examples that you want to discuss.

If you copy and paste any of your bash history, make sure that you don't post anything sensitive. Create dummy directories for working with files, don't post any passwords, etc.

The assignment should take about 30 to 45 minutes to complete.

Homework Submissions (4 total):

zlu (Self-grade: Outstanding)
Submitted 7 months ago

easy chapter

Permalink
johnny (Self-grade: Outstanding)
Submitted 7 months ago

Discussion in 4.8.3 has a nice one-liner for running a command and verbosely exiting if it fails: cmd || { printf "%b" "FAILED.\n" ; exit 1 ; }

set -e could also be interesting, but I have typically wrapped most if not all of my commands in 'if' or 'while' loops which negates the effect.

Permalink
kday (Self-grade: Outstanding)
Submitted 7 months ago

Nice chapter. I've been looking for something similar to nohup for a long time. I've actually resorted to using cron at times for one-off long running tasks. nohup is going to save me a lot of trouble :)

Permalink
bhrgunatha (Self-grade: Outstanding)
Submitted 2 months ago

Weird I knew about using && || and & in scripts and commands, but never came across running commands sequentially separated by a semi-colon. Weird what gaps we have in our knowledge.

Permalink

Recent Class Activity

jvleta joined Bash Scripting
2 weeks ago
BTheMad joined Bash Scripting
1 month ago
bhrgunatha submitted Lesson 3 HW 1
2 months ago
rch joined Bash Scripting
2 months ago
kday commented on johnny's homework
2 months ago
bhrgunatha submitted Lesson 2 HW 1
2 months ago
bhrgunatha commented on johnny's homework
2 months ago
kday submitted Lesson 8 HW 1
2 months ago

Class Members (74)

jvleta
Joined 2 weeks ago
BTheMad
Joined 1 month ago
rch
Joined 2 months ago
adaptives
Joined 2 months ago
bhrgunatha
Joined 3 months ago
kksm19820117
Joined 3 months ago
kevinelliott
Joined 3 months ago
JessicaParkers
Joined 4 months ago

All members


License

Attribution Non-Commercial Share Alike