Stick To The Script Flashcards
1
Q
Command to replace data for consistency
ie: 2 sets of datasets to be analyzed together
A
sed command (stream editor)
sed s/(old_value)/(replacement_value)
2
Q
Command for data extraction and reporting against streams of text
A
awk
awk -F(delimiter) ‘{print $(field_number)}’
-F is the option for doing field separation
3
Q
How do you declare a shell script using bash?
A
(hashtag)#!/bin/bash
Shebang-bin-bash
4
Q
Command to make a shell script executable
A
chmod +x
5
Q
Common text editors available within terminal
A
nano
vi
vim
emacs
6
Q
Syntax to Pass Arguments
A
$1(argument 1) $2 (argument 2)….
$0 is always used to print the filename of the script that is currently being executed