Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Learn Renku
Teaching on Renku
Advanced teaching automation
Commits
f4afb030
Commit
f4afb030
authored
Mar 22, 2022
by
Cyril Matthey-Doret
Browse files
add oneliner to combine forks from two runs
parent
82e3d6e2
Pipeline
#332017
passed with stage
in 2 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
docs/oneliners.md
View file @
f4afb030
...
...
@@ -26,7 +26,7 @@ $ jq '
*
Find all students present in multiple groups
```
sh
$
jq
'.[]
|
.members
| map(.name) | .[]
'
forks.json
\
$
jq
'.[].members
[].name
'
forks.json
\
|
sort
\
|
uniq
-dc
...
...
@@ -39,10 +39,15 @@ $ jq '.[] | .members | map(.name) | .[]' forks.json \
# 1. Get the list of students in groups, sort it
# 2. Sort the list of all enrolled students
# 3. Find names which are in enrolled students, but not grouped students
jq
'.[]
|
.members
| map(.name) | .[]
'
forks.json
\
$
jq
'.[].members
[].name
'
forks.json
\
|
sort
\
|
uniq
-d
\
|
sed
's/^ *//'
\
|
comm
-23
<
(
sort
enrolled_students.txt
)
-
"John Smith"
```
*
Combine forks from two different runs into a single json (for groups present in both files, the entry from run1.json is selected).
```
sh
jq
-s
'.[0] + .[1] | unique_by(.group)'
run1.json run2.json
>
both_runs.json
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment