From b2644a413d92298daf25537c200f606a5f9957c0 Mon Sep 17 00:00:00 2001 From: Natalie Elphick Date: Tue, 12 Mar 2024 10:04:42 -0700 Subject: [PATCH] fix link to regex resource and update pt 2 slides --- docs/Intro_to_Unix_Part_1.html | 18 +++++++----- docs/Intro_to_Unix_Part_2.html | 29 +++++++++---------- .../Intro_to_Unix_Part_1.Rmd | 6 ++-- .../Intro_to_Unix_Part_2.Rmd | 13 ++++----- 4 files changed, 32 insertions(+), 34 deletions(-) diff --git a/docs/Intro_to_Unix_Part_1.html b/docs/Intro_to_Unix_Part_1.html index 3ab8ee8..8c45585 100644 --- a/docs/Intro_to_Unix_Part_1.html +++ b/docs/Intro_to_Unix_Part_1.html @@ -2266,9 +2266,9 @@ macOS 14.1 January 9, 2021 macOS 14.1 data
  • Strings : sequence of characters
  • -
    message="Hello, World!"
    +
    message="Hello, World"
     echo $message
    -
    Hello, World!
    +
    Hello, World

    Here, we assign the string “Hello, World!” to the variable message and use echo to print its value.

    @@ -2351,8 +2351,8 @@ size)
    ls -lah part_1
    total 8
    -drwx---rw-@ 4 nelphick  staff   128B Mar 11 10:11 .
    -drwxr-xr-x@ 5 nelphick  staff   160B Mar 11 10:11 ..
    +drwx---rw-@ 4 nelphick  staff   128B Mar 12 09:18 .
    +drwxr-xr-x@ 5 nelphick  staff   160B Mar 12 09:27 ..
     -rw-r--r--@ 1 nelphick  staff     0B Apr 11  2023 .hidden_file.txt
     -rw-r--r--@ 1 nelphick  staff    60B Apr 12  2023 list_numbers.tsv
    @@ -2365,8 +2365,8 @@ ls -l
    cd ..
     ls -l
    total 0
    -drwx---rw-@ 4 nelphick  staff  128 Mar 11 10:11 part_1
    -drwxr-xr-x@ 3 nelphick  staff   96 Mar 11 10:11 part_2
    +drwx---rw-@ 4 nelphick staff 128 Mar 12 09:18 part_1 +drwxr-xr-x@ 3 nelphick staff 96 Mar 12 09:27 part_2
    @@ -2441,7 +2441,9 @@ used on cannot be recovered
    du -h */*
      0B    new_directory/new_file1.txt
     4.0K    part_1/list_numbers.tsv
    -

    -h - Displays the output in human readable format

    +
      +
    • h - Displays the output in human readable format
    • +

    Check-in

    @@ -2573,7 +2575,7 @@ directory

    Regular Expressions

      -
    • For a more extensive overview of regular expressions click here
    • +
    • For a more extensive overview of regular expressions click here
    • Some basic ones are:
      • ” ^ ” Matches the beginning of a line
      • diff --git a/docs/Intro_to_Unix_Part_2.html b/docs/Intro_to_Unix_Part_2.html index fb1eb7f..32cf046 100644 --- a/docs/Intro_to_Unix_Part_2.html +++ b/docs/Intro_to_Unix_Part_2.html @@ -1932,7 +1932,7 @@ files and/or folders that have been compressed

        du -h part_2/homo_sapiens.refseq.tsv
         33M    part_2/homo_sapiens.refseq.tsv
          -
        • The uncompressed file is 27 megabytes
        • +
        • The uncompressed file is 33 megabytes
        gzip part_2/homo_sapiens.refseq.tsv
         du -h part_2/homo_sapiens.refseq.tsv.gz
        @@ -1961,9 +1961,9 @@ compressed archive files
        tar -czf part_1.tar.gz part_1
         ls -l
        total 8
        -drwx---rw-@ 4 nelphick  staff  128 Mar 11 10:11 part_1
        --rw-r--r--@ 1 nelphick  staff  800 Mar 11 10:11 part_1.tar.gz
        -drwxr-xr-x@ 4 nelphick  staff  128 Mar 11 10:11 part_2
        +drwx---rw-@ 4 nelphick staff 128 Mar 12 09:36 part_1 +-rw-r--r-- 1 nelphick staff 803 Mar 12 10:00 part_1.tar.gz +drwxr-xr-x@ 4 nelphick staff 128 Mar 12 10:00 part_2
        • -c: create a new archive
        • -f: specify the name of the archive file
        • @@ -2024,8 +2024,11 @@ system’s state
        • $PWD : The working directory
        • $HOME : The current user’s home directory
        • $PS1 : the shell prompt string
        • -
        • $TEMP : location of temporary files
        • +
        • $TMPDIR : location of temporary files
        +

        These can change depending on the specific OS or program, +TMPDIR can also be TEMP, +TEMPDIR and TMP.

    PATH: locations of executable files

    @@ -2106,13 +2109,13 @@ interpreter is
  • By default, files are not executable
  • ls -l part_2/example_script.sh
    -
    -rw-r--r--@ 1 nelphick  staff  287 Mar 11 10:11 part_2/example_script.sh
    +
    -rw-r--r--  1 nelphick  staff  287 Mar 12 10:00 part_2/example_script.sh
    • We can set the execute bit like this
    chmod u+x part_2/example_script.sh
     ls -l part_2/example_script.sh
    -
    -rwxr--r--@ 1 nelphick  staff  287 Mar 11 10:11 part_2/example_script.sh
    +
    -rwxr--r--  1 nelphick  staff  287 Mar 12 10:00 part_2/example_script.sh

    Example

    @@ -2188,7 +2191,7 @@ fi # end if statement language
  • It reads and modifies text line by line from a file or input stream
  • -
  • Supports regular +
  • Supports regular expressions
  • Useful for replacing text
  • @@ -2283,12 +2286,6 @@ Bruce Barnett

    End of Part 2

    -
    -
    -

    Survey

    -

    Additional learning materials

    @@ -2307,11 +2304,11 @@ Line
    -
    +

    Survey

    diff --git a/intro-unix-command-line/Intro_to_Unix_Part_1.Rmd b/intro-unix-command-line/Intro_to_Unix_Part_1.Rmd index abe1b04..f433d8c 100644 --- a/intro-unix-command-line/Intro_to_Unix_Part_1.Rmd +++ b/intro-unix-command-line/Intro_to_Unix_Part_1.Rmd @@ -163,7 +163,7 @@ man -P cat man | col -b - **Variables** : a named container that holds a value or data - **Strings** : sequence of characters ```{r, engine='bash', eval=TRUE, results='markup', highlight=FALSE, comment=NA, echo = TRUE} -message="Hello, World!" +message="Hello, World" echo $message ``` @@ -347,7 +347,7 @@ rm new_directory/new_file2.txt ```{r, engine='bash', eval=TRUE, results='markup', highlight=FALSE, comment=NA} du -h */* ``` --h - Displays the output in human readable format +- h - Displays the output in human readable format ## Check-in @@ -447,7 +447,7 @@ grep "7" part_1/list_numbers.tsv ## Regular Expressions -- For a more extensive overview of regular expressions click [here](https://v4.software-carpentry.org/regexp/index.html) +- For a more extensive overview of regular expressions click [here](https://regexone.com/lesson/introduction_abcs) - Some basic ones are: - " ^ " Matches the beginning of a line - " . " Matches any single character except newline diff --git a/intro-unix-command-line/Intro_to_Unix_Part_2.Rmd b/intro-unix-command-line/Intro_to_Unix_Part_2.Rmd index a5dd340..5e84086 100644 --- a/intro-unix-command-line/Intro_to_Unix_Part_2.Rmd +++ b/intro-unix-command-line/Intro_to_Unix_Part_2.Rmd @@ -89,7 +89,7 @@ gunzip part_2/homo_sapiens.refseq.tsv.gz du -h part_2/homo_sapiens.refseq.tsv ``` -- The uncompressed file is 27 megabytes +- The uncompressed file is 33 megabytes ```{r, engine='bash', eval=TRUE, results='markup', highlight=FALSE, comment=NA, echo = TRUE} gzip part_2/homo_sapiens.refseq.tsv @@ -162,7 +162,9 @@ echo $HOME - **$PWD** : The working directory - **$HOME** : The current user's home directory - **$PS1** : the shell prompt string -- **$TEMP** : location of temporary files +- **$TMPDIR** : location of temporary files + +These can change depending on the specific OS or program, **TMPDIR** can also be **TEMP**, **TEMPDIR** and **TMP**. @@ -309,7 +311,7 @@ fi # end if statement - Parses and transforms text, using a compact programming language - It reads and modifies text line by line from a file or input stream -- Supports [regular expressions](https://v4.software-carpentry.org/regexp/index.html) +- Supports [regular expressions](https://regexone.com/lesson/introduction_abcs) - Useful for replacing text Example: @@ -394,10 +396,7 @@ END {print sum / count}' -## Survey -- Please take some time to fill out the workshop survey: -https://www.surveymonkey.com/r/DY7K5ZY ## Additional learning materials @@ -412,7 +411,7 @@ https://www.surveymonkey.com/r/DY7K5ZY ## Survey - Please take some time to fill out the workshop survey: -https://www.surveymonkey.com/r/F75J6VZ +https://www.surveymonkey.com/r/DY7K5ZY ## Upcoming Data Science Training Program Workshops