Skip to content

Instantly share code, notes, and snippets.

@jjsahalf
Created March 26, 2017 22:06
Show Gist options
  • Save jjsahalf/86ea0ecebd48930db20eca21abc22ec2 to your computer and use it in GitHub Desktop.
Save jjsahalf/86ea0ecebd48930db20eca21abc22ec2 to your computer and use it in GitHub Desktop.
stream editor (sed) and basic string operations
#!/bin/bash
ls | grep _logs |sed 's/_logs//g' | while read line
do
echo $line
v1="${line}_logs/${line}_white_list"
v2="${line}_logs/${line}_class_white_list"
if [ -f $v1 ]; then
echo "${v1} exists"
else
echo "${v1} does not exist!"
fi
if [ -f $v2 ]; then
echo "${v2} exists"
else
echo "${v2} does not exist!"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment