Skip to content

Instantly share code, notes, and snippets.

@songritk
Last active August 2, 2017 07:10
Show Gist options
  • Save songritk/434a02ab4bf9a08da28394f0bebbf055 to your computer and use it in GitHub Desktop.
Save songritk/434a02ab4bf9a08da28394f0bebbf055 to your computer and use it in GitHub Desktop.
#!/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
@songritk
Copy link
Author

songritk commented Aug 2, 2017

#!/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