Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
sword-jin committed Jan 22, 2019
1 parent 336f7ff commit af05a14
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 15 deletions.
1 change: 1 addition & 0 deletions Linux-Shell/awk-1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
awk '{if ($4 == "") print "Not all scores are available for", $1 }'
1 change: 1 addition & 0 deletions Linux-Shell/awk-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
awk '{if ($1 >= 50 && $2 >= 50 && $3 >= 50) print $1, ": Pass"; else print $1, ": Fail";}'
1 change: 1 addition & 0 deletions Linux-Shell/awk-3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
awk '{if ($1 >= 50 && $2 >= 50 && $3 >= 50) print $1, ": Pass"; else print $1, ": Fail";}'
1 change: 1 addition & 0 deletions Linux-Shell/awk-4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
awk 'ORS=NR%2? ";":"\n"'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
for line in `cat`; do
countries=( "${countries[@]}" $line )
done

countries=("${countries[@]}" "${countries[@]}" "${countries[@]}")
echo "${countries[@]}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arr=($(cat))
echo ${#arr[@]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a=($(cat))
echo ${a[3]}
2 changes: 2 additions & 0 deletions Linux-Shell/bash-tutorials-filter-an-array-with-patterns.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arr=($(cat))
echo ${arr[@]/*[aA]*/}
3 changes: 3 additions & 0 deletions Linux-Shell/bash-tutorials-read-in-an-array.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 1
paste -sd ' '

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arr=($(cat))
echo ${arr[@]/[A-Z]/.}
2 changes: 2 additions & 0 deletions Linux-Shell/bash-tutorials-slice-an-array.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arr=($(cat))
echo ${arr[@]:3:5}
2 changes: 2 additions & 0 deletions Linux-Shell/lonely-integer-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
read
tr ' ' '\n' | sort | uniq -u
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-in-linux-the-grep-command-1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grep -wi 'the'
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-in-linux-the-grep-command-3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grep -viw that
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-in-linux-the-grep-command-4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grep -Eiw 'the|that|then|those'
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-in-linux-the-grep-command-5.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grep '\([0-9]\) *\1'
2 changes: 2 additions & 0 deletions Linux-Shell/text-processing-in-linux-the-sed-command-1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sed -e 's/\<the\>/this/'

1 change: 1 addition & 0 deletions Linux-Shell/text-processing-in-linux-the-sed-command-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sed -E 's/[tT][hH][yY]/your/g'
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-in-linux-the-sed-command-3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sed -E 's/thy/{&}/gi'
25 changes: 10 additions & 15 deletions Linux-Shell/text.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
Albany, N.Y.
Albuquerque, N.M.
Anchorage, Alaska
Asheville, N.C.
Atlanta, Ga.
Atlantic City, N.J.
Austin, Texas
Baltimore, Md.
Baton Rouge, La.
Billings, Mont.
Birmingham, Ala.
Bismarck, N.D.
Boise, Idaho
Boston, Mass.
Bridgeport, Conn.
Namibia
Nauru
Nepal
Netherlands
NewZealand
Nicaragua
Niger
Nigeria
NorthKorea
Norway

0 comments on commit af05a14

Please sign in to comment.