-
Notifications
You must be signed in to change notification settings - Fork 0
/
.parallel-rc
76 lines (65 loc) · 1.98 KB
/
.parallel-rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
alias plp="parallel -k -j+0 --env PATH"
defn p parallel -k -j+0 --env PATH
parallel_title() {
local _last=("${@: -1}")
local last="${_last[0]}"
set -- "${@:1:$#-1}"
if ! [[ "$last" == *"{}"* ]]; then
last="$last {}"
fi
last="echo {}:; $last"
p "$@" "$last"
}
export -f parallel_title
defn pel parallel_title
defn ptl parallel_title
parallel_title_inline() {
local _last=("${@: -1}")
local last="${_last[0]}"
set -- "${@:1:$#-1}"
if ! [[ "$last" == *"{}"* ]]; then
last="$last {}"
fi
last="echo -n '{}: '; $last"
p "$@" "$last"
}
export -f parallel_title_inline
defn pei parallel_title_inline
defn pet parallel_title_inline
defn pti parallel_title_inline
defn parallel_colsep parallel -k -j+0 --env PATH --colsep
defn pc parallel_colsep
parallel_spaces() {
parallel_colsep ' ' "$@"
}
export -f parallel_spaces
defn pcs parallel_spaces
defn pcl parallel -k -j+0 --env PATH --colsep ':'
defn parallel_delimiter parallel -k -j+0 --env PATH --delimiter
defn pld parallel_delimiter
parallel_delimiter_spaces() {
parallel_delimiter ' ' "$@"
}
export -f parallel_delimiter_spaces
defn pds parallel_delimiter_spaces
defn pdc parallel_delimiter ':'
alias p1="parallel -k -j1 --env PATH"
alias p2="parallel -k -j2 --env PATH"
alias p4="parallel -k -j4 --env PATH"
alias p8="parallel -k -j8 --env PATH"
alias p16="parallel -k -j16 --env PATH"
#alias loop="for f in"
env_parallel() {
export parallel_bash_environment='() {
'"$(echo "shopt -s expand_aliases 2>/dev/null"; alias;typeset -p | grep -vFf <(readonly; echo GROUPS; echo FUNCNAME; echo DIRSTACK; echo _; echo PIPESTATUS; echo USERNAME) | grep -v BASH_;typeset -f)"'
}'
# Run as: env_parallel ...
`which parallel` "$@"
unset parallel_bash_environment
}
alias pj=parallel-j
alias pf=parallel-functions
alias p0="parallel -0 -k --env PATH"
alias pz="parallel -0 -k --env PATH"
alias p01="parallel -0 -j+1 -k --env PATH"
alias pz1="parallel -0 -j+1 -k --env PATH"