Skip to content
Snippets Groups Projects
Commit 42cc2dd4 authored by Nathan Weeks's avatar Nathan Weeks
Browse files

If "tac" doesn't exist (e.g., on non GNU/Linux systems like OS X & other...

If "tac" doesn't exist (e.g., on non GNU/Linux systems like OS X & other BSDs), emulate with sed '1!G;h;$!d' (from http://www.catonmat.net/blog/sed-one-liners-explained-part-one/)

Since the Makefile executes tests using "sh" instead of "bash", use the more portable "> obs 2>&1" instead of "&> obs" so the test will pass when /bin/sh isn't bash (e.g., on Debian-based Linux distributions, and most non-Linux *nix systems).
parent 1de5f0a5
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,7 @@ rm obs exp ...@@ -36,6 +36,7 @@ rm obs exp
# Enforce coordinate sorted input. # Enforce coordinate sorted input.
########################################################### ###########################################################
echo " merge.t2...\c" echo " merge.t2...\c"
command -v tac 2>/dev/null || alias tac="sed '1!G;h;\$!d'"
tac a.bed | $BT merge -i - 2> obs tac a.bed | $BT merge -i - 2> obs
echo "ERROR: input file: (-) is not sorted by chrom then start. echo "ERROR: input file: (-) is not sorted by chrom then start.
The start coordinate at line 3 is less than the start at line 2" > exp The start coordinate at line 3 is less than the start at line 2" > exp
...@@ -67,7 +68,7 @@ echo \ ...@@ -67,7 +68,7 @@ echo \
***** *****
*****ERROR: No names found to report for the -names option. Exiting. *****ERROR: No names found to report for the -names option. Exiting.
*****" > exp *****" > exp
$BT merge -i a.bed -nms &> obs $BT merge -i a.bed -nms > obs 2>&1
check obs exp check obs exp
rm obs exp rm obs exp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment