Skip to content

Commit

Permalink
add shell
Browse files Browse the repository at this point in the history
  • Loading branch information
sword-jin committed Jan 21, 2019
1 parent 94de38f commit 336f7ff
Show file tree
Hide file tree
Showing 32 changed files with 79 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Linux-Shell/cut-1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

while read line
do
echo $line | cut -c3 -
done

6 changes: 6 additions & 0 deletions Linux-Shell/cut-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

while read line
do
echo $line | cut -c2,7
done
6 changes: 6 additions & 0 deletions Linux-Shell/cut-3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

while read line
do
echo $line | cut -c 2-7
done
6 changes: 6 additions & 0 deletions Linux-Shell/cut-4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

while read line
do
echo $line | cut -c 1-4
done
9 changes: 9 additions & 0 deletions Linux-Shell/cut-5.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!bin/bash

while read line
do
A=`cut -f1 <<<"$line"`
B=`cut -f2 <<<"$line"`
C=`cut -f3 <<<"$line"`
echo "$A $B $C"
done
3 changes: 3 additions & 0 deletions Linux-Shell/cut-6.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!bin/bash

cut -c 13-
3 changes: 3 additions & 0 deletions Linux-Shell/cut-7.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!bin/bash

cut -d' ' -f4
1 change: 1 addition & 0 deletions Linux-Shell/cut-8.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cut -d' ' -f1-3
1 change: 1 addition & 0 deletions Linux-Shell/cut-9.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cut -f2-
1 change: 1 addition & 0 deletions Linux-Shell/parse-1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
paste -sd $'\t\t\n'
1 change: 1 addition & 0 deletions Linux-Shell/parse-3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tr "\n" "\t"
1 change: 1 addition & 0 deletions Linux-Shell/parse-4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
paste -sd $'\t\t\n'
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-head-1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
head -n 20 $1
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-head-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
head -b20
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
head -n22 | tail -11
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-in-linux-the-uniq-command-1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uniq
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-in-linux-the-uniq-command-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uniq -c | xargs -L1
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-in-linux-the-uniq-command-3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uniq -ci | xargs -L1
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-in-linux-the-uniq-command-4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uniq -u
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-sort-1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sort
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-sort-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sort -r
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-sort-3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sort -h
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-sort-4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sort -h -r
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-sort-5.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sort -t $'\t' -k2 -rn
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-sort-6.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sort -t$'\t' -nk2
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-sort-7.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sort -t $'\t' -k2 -rn
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-tail-1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tail -20
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-tail-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tail -c20
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-tr-1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tr "()" "[]"
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-tr-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tr -d "[:lower:]"
1 change: 1 addition & 0 deletions Linux-Shell/text-processing-tr-3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tr -s " "
15 changes: 15 additions & 0 deletions Linux-Shell/text.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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.

0 comments on commit 336f7ff

Please sign in to comment.