Search Results

Search: Posts Made By: trexthurman
3,082
Posted By RudiC
$DIFF in not an array but a scalar variable. ...
$DIFF in not an array but a scalar variable.
Try also
IFS=$'\n'
echo "${array1
}"$'\n'"${array2
}" | sort | uniq -u
Mac meDon't forget to reset IFS to your default value.
3,082
Posted By Scrutinizer
Indeed, the operation should be line based,...
Indeed, the operation should be line based, rather than word based, since file names can have spaces in them.

Compare:
echo "${array1[@]}" "${array2[@]}" | tr ' ' '\n' | sort | uniq -u

with:...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 08:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy