LOCK.IN Expert: scripts that keep the books

Spesialis Riko20 pages

You finish with a script that turns raw text into a report.

Rp 149.000Buy E-Book
LOCK.IN Expert: scripts that keep the books cover

What is inside

All 6 chapters

  1. 1The shell as a tool

    Say where you are, what is there, and what a path means.

  2. 2Pipes and filters

    Turn a file into an answer with three small commands instead of one big one.

  3. 3Python values and functions

    Compute something once, in a way the next person can read.

  4. 4Lists and dictionaries

    Group raw lines into records and print a report from them.

  5. 5Reading input, line by line

    Turn a messy text file into records, and say which lines were bad.

  6. 6Automate the whole job

    Wrap the analysis in a script that is safe to run twice.

Quests and Challenges

  • bank soal
    Build a pipeline, stage by stage+10 XP
  • quiz
    Count and rank, without peeking+15 XP
  • repo
    Ship a script someone else can run+10 XP

Chapter 1: The shell as a tool

Read the first chapter

Where you are, and what is beside you

The shell always has a working directory. pwd prints it, ls lists what is in it, and cd moves. A path that starts with / is absolute: it means the same thing from anywhere. A path that starts with a name is relative to where you are standing.

shell · RunnableRun in playground
pwdls -a /home/studentcd /home/studentpwd
Run it and read the order of the lines.
tipRun `pwd` when a command surprises you

Most "file not found" errors are a path problem, not a missing file. Printing where you are costs one second and answers the question immediately.

Reading and writing a file

cat prints a file. echo prints its arguments. > sends that output into a file instead of the screen, and >> appends to what is already there. That single character is the difference between adding a line and destroying the file.

shell · RunnableRun in playground
cd /home/studentecho "2026-10-24,buy,beginner" > sales.csvecho "2026-10-24,buy,expert" >> sales.csvcat sales.csvwc -l sales.csv
Write, append, then read it back.
trap`>` does not ask

echo hi > sales.csv replaces the whole file with one line, with no backup and no undo. >> is the one you usually want; reach for > when you mean "start this file over".

The other 5 chapters

Every interactive code checkpoint, the PDF edition, Quests and Socratic AI.