Last active
August 2, 2017 07:10
-
-
Save songritk/434a02ab4bf9a08da28394f0bebbf055 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
file=$1 | |
if [ $# -ne 1 ]; then | |
echo "$0 " | |
exit 1 | |
fi | |
grep "cli " $file|cut -d: -f6|sed 's/[//g;s/]//g'|cut -d/ -f1 |sed 's/ //g'> user.txt | |
sort -u user.txt > user-2.txt | |
user=cat user-2.txt | |
for l in $user; do | |
grep $l $file > data2/$l.txt | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#!/bin/bash
file=$1
if [ $# -ne 1 ]; then
echo "$0 "
exit 1
fi
grep "cli " $file|cut -d: -f6|sed 's/[//g;s/]//g'|cut -d/ -f1 |sed 's/ //g'> user.txt
sort -u user.txt > user-2.txt
user=
cat user-2.txt
for l in $user; do
grep $l $file > data2/$l.txt
done