CAE-CD
Technical Core
BSP
CD-BSP Basic Scripting and Programming
The intent of this Basic Scripting and Programming (BSP) Knowledge Unit is to provide students with foundational skills in scripting and programming. It focuses on enabling students to write simple scripts/programs to automate and perform simple operations, and to provide students with the skills necessary to implement scripts and programming languages to solve problems.
Learning outcomes
What a student must demonstrate to claim coverage of this unit. Each outcome links to the skill drills that assess it.
- CD-BSP-O1 Write and execute simple scripts to automate system administration tasks.
- CD-BSP-O2 Write and execute programs in a high-level language using basic programming constructs and concepts
- CD-BSP-O3 Write and execute simple linear and looping scripts.
- CD-BSP-O4 Write and execute simple and compound conditions within a programming language or similar environment (e.g., scripts, macros, SQL).
- CD-BSP-O5 Implement basic security practices in scripting, including bounds checking and input validation.
- CD-BSP-O6 Demonstrate conceptual understanding and practical use of regular programming or scripting expressions.
Topics
The content areas within this unit. Curricula must cover an appropriate subset.
- CD-BSP-T2 Permissions (e.g., Linux, Windows, MacOS), bounds checking, input validation, type checking and parameter validation
- CD-BSP-T3 Fundamental concepts and basic implementation of regular expressions
- CD-BSP-T6 Scripting language on both Windows and Linux (e.g. PERL, Python, BASH, JAVA, VB Scripting, Powershell)
- CD-BSP-T8a Variables and types (e.g., int, float, char, etc.)
- CD-BSP-T8d Assignments (e.g., :=, =, ++, --, etc.)
- CD-BSP-T8i Console and file I/O
EWU courses that cover this unit
CSCD300
partial
CSCD 300 — Data Structures
CSCD350
partial
CSCD 350 — Software Engineering Principles
CSCD240-S26
primary
CSCD 240 — C and Unix Programming
Basic Scripting and Programming.
CSCD210
primary
CSCD 210 — Programming Principles I
Basic Scripting and Programming via Java.
CSCD240
primary
CSCD 240 — C and Unix Programming
Basic Scripting and Programming: shell, C, makefiles, control flow.
CSCD110
strong
CSCD 110 — Introduction to Computer Programming
Basic Scripting and Programming.
CSCD211
strong
CSCD 211 — Programming Principles II
Extends BSP with OOP and event-driven programming.
CSCD212
strong
CSCD 212 — Advanced Unix Environment
Advanced scripting.
CSCD 240 lectures and labs
Lectures
- CSCD240-S26-L07 I/O redirection, aliases, source, .bashrc, env
- CSCD240-S26-L08 Pipes, filters, grep, sort, uniq, wc, tar
Labs
- CSCD240-S26-LAB4 Linux Lab 4: Redirection and Environment
- CSCD240-S26-LAB5 Linux Lab 5: Quoting and File Utilities
- CSCD240-S26-LAB6 Linux Lab 6: Processes and Pipes
Exam questions that cite this unit
- CSCD240-E1-A-Q14 grep-recursive Show the filenames containing "printf" in all .c files in home directory and subdirs.
- CSCD240-E1-A-Q15 env-path Add /opt/tools/bin to PATH for the current shell.
- CSCD240-E1-A-Q20 background Execute firefox and allow the shell to be used for other activities.
- CSCD240-E1-A-Q25 alias Create alias ll for long listing with human-readable file sizes.
- CSCD240-E1-A-Q28 globbing Files: data, data1, data12, data2. Display only data1 and data12 via ls.
- CSCD240-E1-A-Q29 regex contacts.txt has Name<tab>number lines. Print only those whose number ends with 6.
- CSCD240-E1-A-Q31 quoting var="Stu Steiner". A) echo "Hello $var" B) echo 'Hello $var'. Explain difference and output.
- CSCD240-E1-A-Q35 redir-stderr Send only stderr of "scan /etc/shadow" to errors.log; keep stdout on terminal.
- CSCD240-E1-A-Q36 redir-merge Send BOTH stdout and stderr of build.sh into build.log.
- CSCD240-E1-A-Q38 pipeline-distinct Count distinct lines in visitors.txt (unsorted input).
- CSCD240-E1-A-Q39 assignment A) FOO=bar B) FOO = bar. Which is valid? One-sentence explanation of the error.
- CSCD240-E1-A-Q43 history-expansion Forgot sudo on previous command. Re-run with sudo prepended without retyping.
- CSCD240-E1-A-Q44 history Bash keystroke that begins reverse-incremental history search.
- CSCD240-E1-A-Q45 command-substitution Print "Backup taken on <today>" using $(date +%Y-%m-%d) as the date.
- CSCD240-E1-A-Q46 env Display every environment variable currently defined in your shell.
- CSCD240-E1-A-Q50 log-pipeline auth.log line format "2026-04-14 08:31 FAIL user=alex src=10.x". Print top-3 FAIL source IPs, count first, most-frequent first.
- CSCD240-E1-B-Q15 redir Send only stderr of "scan /etc/shadow" to errors.log; leave stdout on terminal.
- CSCD240-E1-B-Q16 redir Send BOTH stdout and stderr of build.sh to build.log.
- CSCD240-E1-B-Q19 log-pipeline Top 5 source IPs in FAIL lines of auth.log, where IP is field 5.
- CSCD240-E1-B-Q22 regex-alt Print lines of fw.log matching DENY OR DROP (extended regex).
- CSCD240-E1-B-Q39 quoting var="Red Team". A) echo "Go $var" B) echo 'Go $var'. Output + explain difference.
- CSCD240-E1-B-Q40 assignment A) FOO=bar B) FOO = bar. Which valid; explain error.
- CSCD240-E1-B-Q41 command-subst Print "Backup taken on <today>" using $(date +%F).
- CSCD240-E1-B-Q42 env-path Append /opt/tools/bin to PATH for current shell.
- CSCD240-E1-B-Q43 shell-config Reload ~/.bashrc without opening a new terminal.
- CSCD240-E1-B-Q44 alias Alias lsm = ls -lah --sort=time.
- CSCD240-E1-B-Q47 history Re-run the previous command with sudo prepended without retyping.
- CSCD240-E1-B-Q48 history Bash keystroke to begin reverse-incremental history search.
- CSCD240-E1-C-Q05 redir Which redirection sends only stderr of a command to a file err.log?
- CSCD240-E1-C-Q09 quoting NAME=ops. echo '$NAME' prints what?
CTF challenges aligned to this unit
RTFM (Respectfully)
01 Shell & Help (10 pts)
Oops, Need Sudo
01 Shell & Help (20 pts)
Identity Check
01 Shell & Help (25 pts)
Search Your Past
01 Shell & Help (25 pts)
Built-in Docs
01 Shell & Help (25 pts)
The Overwriter
03 I/O & Pipelines (10 pts)
Don't Erase, Just Add
03 I/O & Pipelines (10 pts)
Just the Lines, Please
03 I/O & Pipelines (10 pts)
Stream Number 2
03 I/O & Pipelines (10 pts)
The Error Stream
03 I/O & Pipelines (10 pts)
The Input Stream
03 I/O & Pipelines (10 pts)
The Output Stream
03 I/O & Pipelines (10 pts)
Numbers Are Not Words
03 I/O & Pipelines (10 pts)
Two for One
03 I/O & Pipelines (10 pts)
Catch Only Errors
03 I/O & Pipelines (20 pts)
where data
03 I/O & Pipelines (30 pts)
What's in $HOME?
04 Environment & Patterns (10 pts)
Match Anything
04 Environment & Patterns (10 pts)
Exactly One Character
04 Environment & Patterns (10 pts)
Shortcut Maker
04 Environment & Patterns (10 pts)
The Startup File
04 Environment & Patterns (10 pts)
Show Me Everything
04 Environment & Patterns (10 pts)
The Divider
04 Environment & Patterns (10 pts)
Mind the Gap
04 Environment & Patterns (15 pts)
Reload Without Restarting
04 Environment & Patterns (15 pts)
Literal vs Expanded
04 Environment & Patterns (25 pts)
Capture the Output
04 Environment & Patterns (25 pts)
Its a trap
04 Environment & Patterns (50 pts)