Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EDTbash
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Wang Gao
EDTbash
Commits
4cce6857
Commit
4cce6857
authored
Jul 05, 2019
by
Wang Gao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'liste_etu_par_UV'
parents
e17e0133
bc9e1042
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
listEtu_par_UV.sh
listEtu_par_UV.sh
+50
-0
No files found.
listEtu_par_UV.sh
0 → 100755
View file @
4cce6857
#!/bin/bash
# let user to input the UV
# list all student of this UV
# The second line of *.edt files has the sufficiant info
# e.g.
# zhajingq IM02 5 EN21 FQ01 LA92 MQ03 TN02
# Créer une catalogue UV
awk
'FNR==2 {print $0}'
./data/
*
.edt
>
inscrit.tmptxt
awk
'{$1=""; $2=""; $3=""; print $0}'
inscrit.tmptxt
>
alluv.tmptxt
# awk '{printf("%s ", $0)}' alluv.tmptxt | awk '{for (i=1;i<=NF;i++) print $i}' | sort > catalogue_UV.tmptxt
awk
'{printf("%s ", $0)}'
alluv.tmptxt |
awk
'{for (i=1;i<=NF;i++) print $i}'
|
sort
-u
>
catalogue_UV.tmptxt
# for a given user input, check if it is an UV
function
f_exist_uv
(){
local
exist
for
item
in
$(
cat
catalogue_UV.tmptxt
)
;
do
if
[
"
$1
"
==
"
$item
"
]
;
then
echo
you are good to go
# 0 = true exist
return
0
fi
done
return
# 1 = false not exist
}
# Ask user to tape an UV code
echo
"Which UV do you want to know about ?"
read
choosedUV
# re-ask user if it is not an UV
while
[
"0"
==
$(
f_exist_uv
$choosedUV
)
]
;
do
if
f_exist_uv
$choosedUV
;
then
echo
"UV non exsitante, veuillez re selectionner"
read
choosedUV
fi
done
# For an valided UV code, list students
grep
-hnr
"
$choosedUV
"
inscrit.tmptxt |
awk
'{print FILENAME, $0}'
>
$choosedUV
.tmptxt
awk
'BEGIN{print "login ","\tSemestre" ;
print"------------------------------"}
{print $3,"\t",$4}'
$choosedUV
.tmptxt
# cleanups
rm
*
.tmptxt
\ No newline at end of file
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