KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a variable $data and variable $file in a bash script: data=$(echo "$(printf '%s\n' "${array[@]/%/$'\n\n'}")") file=$(<scriptfile_results) Those variables will contain text. How to compare those two? One option is to use diff (1) utility like this: diff -u <(echo "$data") <(echo "$file") Is this an correct and elegant way to compare content of two variables? In addition how is the <( ) technique called? As I understand, for each <( ) a temporary file(named pipe) is created..
Tags (comma-separated)
Save Edits
Cancel