11
votes
Accepted
What does mean `^(*.c|*.md)`
In Zsh, ^ is a glob operator available when EXTENDED_GLOB is set, matching anything except the following pattern.
The parentheses group a pattern; this is useful in particular with disjunctions (|) ...
1
vote
Read nth column iteratively in two large files, cut and paste side by side to create new nth file
Assumptions:
all files have at least one row (the header)
all files have the same number of rows
all files have the same number of columns
all files can fit into memory (via an awk array)
General ...
1
vote
Accepted
Read nth column iteratively in two large files, cut and paste side by side to create new nth file
Like this, using bash and awk to get number of columns and usual commands in the toolchest:
#!/bin/bash
for i in $(seq 1 $(awk '{print NF;exit}' test1.txt)); do
paste <(sed 1d test1.txt | cut ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
shell × 11935bash × 4095
shell-script × 2375
linux × 1416
scripting × 728
command-line × 684
zsh × 509
quoting × 498
awk × 478
terminal × 439
sed × 423
ssh × 378
text-processing × 374
files × 374
io-redirection × 370
find × 366
grep × 347
pipe × 327
wildcards × 308
environment-variables × 266
variable × 246
ubuntu × 212
posix × 189
process × 182
filenames × 172