Last active
June 25, 2020 13:32
-
-
Save XIIIVI/607e1973e6da1ea014f55976e0a1847f to your computer and use it in GitHub Desktop.
This file contains 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
# | |
# is_file_included | |
# - param1: original file | |
# - param2: contained file | |
# | |
is_file_included() { | |
local ORIGINAL_FILE=${WORKDIR}/file1 | |
local CONTAINED_FILE=${WORKDIR}/file2 | |
# Remove all the blank lines | |
# Trim each line | |
awk NF ${1} | awk '{$1=$1;print}' > ${ORIGINAL_FILE} | |
awk NF ${2} | awk '{$1=$1;print}' > ${CONTAINED_FILE} | |
if [ "$(grep -Fxf ${ORIGINAL_FILE} ${CONTAINED_FILE})" = "$(cat ${CONTAINED_FILE})" ]; then | |
echo "true" | |
else | |
echo "false" | |
fi | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment