-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.sh
More file actions
79 lines (56 loc) · 2.09 KB
/
Copy pathtests.sh
File metadata and controls
79 lines (56 loc) · 2.09 KB
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
77
78
79
#!/bin/bash
set -e
echo "3 groups and a couple of backrefs:"
lup echo " - @hello,goodbye@ @old,new@ @world,friend@ (@1@ @3@)"
echo "\nPipe:"
sh -c "echo ' - hello' | lup cat @-n,-e@"
echo "\nBackref hidden group"
lup @-:1..3@ echo " - Iteration @1@"
echo "\nRange"
lup echo " - @1..3@"
echo "\nVirsh"
lup echo " - virsh @destroy,start@ @dev,test@_@1..3@"
echo "\nEscaped double quote inside single quotes"
lup echo ' - this\"works'
echo "\nEscaped double quote inside double quotes"
lup echo " - this\"too"
echo "\nDoubles in singles"
lup echo '"hello world"'
echo "\nMisc quotes"
lup echo " - "double quoted""
lup echo ' - 'single quoted''
lup echo " - \"nested\""
lup echo " - 'nested'"
echo "\nMatch files:"
lup echo " - @files:/tmp/*@" "(@1@)"
echo "\nMatch dirs"
lup echo " - @dirs:/tmp/*@" "(@1@)"
echo "\nMatch all"
lup echo " - @all:/tmp/*@" "(@1@)"
echo "\nMatch files with prefix and wildcard"
lup echo " - /tmp/*@files:*@" "(@1@)"
echo "\nMatch dirs with prefix and wildcard"
lup echo " - /tmp/dirs/@dirs:*@" "(@1@)"
echo "\nMatch dirs with prefix and double wildcard"
lup echo " - /tmp/d?rs/@dirs:*@" "(@1@)"
echo "\nMatch files with prefix and full path"
lup echo " - /tmp/@files:*@" "(@1@)"
echo "\nMatch dirs with prefix and full path"
lup echo " - /tmp/@dirs:*@" "(@1@)"
echo "\nLines in file"
echo "hello\nworld\nwhat's\nup?\nOh \"good" > /tmp/luptests/tests.txt
lup echo " - @lines:/tmp/luptests/tests.txt@"
lup echo ' - @lines:/tmp/luptests/tests.txt@'
lup echo ' - nesting:"@lines:/tmp/luptests/tests.txt@"'
lup echo " - nesting:'@lines:/tmp/luptests/tests.txt@'"
lup echo @lines:/tmp/luptests/tests.txt@
echo "\nEscaped at outside quotes"
lup echo " - " root\\@lab-@0..2@.test
echo "\nEscaped at inside singles"
lup echo ' - root\@lab-@0..2@.test'
echo "\nEscaped at inside doubles"
lup echo " - root\@lab-@0..2@.test"
echo "\nescaped comma inside, escaped ats in both (double quote):"
lup echo " - @Hello,Bonjour,Yo\, \@wud up@ user\@domain"
echo "\nescaped comma inside, escaped ats in both (single quote):"
lup echo ' - @Hello,Bonjour,Yo\, \@wud up@ user\@domain'