Skip to content

Commit 90ff858

Browse files
Add FreeBSD and Mac support
1 parent dbc3839 commit 90ff858

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

grcat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/python3
1+
#!/usr/bin/env python3
22

33
import sys, os, string, re, signal, errno
44

mycat

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1-
#!/usr/bin/env zsh
1+
#!/usr/bin/env bash
22

3-
${0:a:h}/mycat.sed | ${0:a:h}/grcat ${0:a:h}/mysql.grcat | less -S -R -M;
3+
if [[ $OSTYPE == "linux-gnu" ]]; then
4+
sed -f "$( dirname "${BASH_SOURCE[0]}" )"/mycat.sed | "$( dirname "${BASH_SOURCE[0]}" )"/grcat "$( dirname "${BASH_SOURCE[0]}" )"/mysql.grcat | less -S -R -M;
5+
else
6+
if [[ $OSTYPE == "freebsd"* || $OSTYPE == "darwin"* ]]; then
7+
gsed -f "$( dirname "${BASH_SOURCE[0]}" )"/mycat.sed | "$( dirname "${BASH_SOURCE[0]}" )"/grcat "$( dirname "${BASH_SOURCE[0]}" )"/mysql.grcat | less -S -R -M;
8+
fi
9+
fi
10+
11+
echo "$( dirname "${BASH_SOURCE[0]}" )"

mycat.sed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sed -f
1+
#!/usr/bin/env sed -f
22
s!^|!!g;s!|$!!g;s!|!!g;
33
/^+/bp;b
44
:p x;/^/bm;/^/bl

0 commit comments

Comments
 (0)