Skip to content

initrd.scripts: fs_type_in_use() simplification#26

Open
Karlson2k wants to merge 1 commit intogentoo:masterfrom
Karlson2k:fs_type_in_use_1
Open

initrd.scripts: fs_type_in_use() simplification#26
Karlson2k wants to merge 1 commit intogentoo:masterfrom
Karlson2k:fs_type_in_use_1

Conversation

@Karlson2k
Copy link

One more simplification and speed-up.
When processing the file directly grep could exit at the first match, without processing the whole stream.

Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
fs_type_in_use() {
fs_type=$1
cut -d ' ' -f 3 < /proc/mounts | grep -Fq "${fs_type}"
grep -Eqse "^[^ ]+ [^ ]+ ${1} " /proc/mounts
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see my comments on PR#27 and switch to using awk instead.

Much cleaner to understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants