From 17c5241c1a6868c23d8de98a7a455ab5b9ce1b57 Mon Sep 17 00:00:00 2001 From: Shunsuke Takagi Date: Wed, 10 Aug 2022 02:39:29 +0900 Subject: [PATCH] added bash file awnsoer --- Piscines/C/Day01/answers/ex07/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Piscines/C/Day01/answers/ex07/README.md b/Piscines/C/Day01/answers/ex07/README.md index 2add0e3..52107cd 100644 --- a/Piscines/C/Day01/answers/ex07/README.md +++ b/Piscines/C/Day01/answers/ex07/README.md @@ -10,4 +10,14 @@ We still need to deconstruct the problem and explain the solution for... | sed -e 's/, */, /g' -e 's/.$//' -e 's/.\{3\}$//' ``` ->> This answer is still missing the ending with a dot (.) +>> This answer is still missing the ending with a dot (. + +the curriculum says need bash file. +so, +```#!/bin/sh +cat /etc/passwd | sed -e 's/#.*//' -e 's/[ ^I]*$//' -e '/^$/ d' -e 's/:.*//g' \ + | tr '\n' ',' | rev | tr "," "\n" | sort -r | tr "\n" "," \ + | sed -e 's/, */, /g' -e 's/.$//' -e 's/.\{3\}$//' +echo ".")``` + +i think it's better. by tkgshn