[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is there any way to intercept "linux" command call and change its args?
From: |
Adam Vodopjan |
Subject: |
Is there any way to intercept "linux" command call and change its args? |
Date: |
Sun, 4 Jun 2023 18:41:56 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 |
I make a grub config to boot iso images which provide loopback.cfg. So
after some preliminary steps I run `configfile /boot/grub/loopback.cfg`
and it works as supposed.
The problem is I'd like to modify `linux`'s args used in `loopback.cfg`
(or its subsequent configs) without touching the iso images.
Speaking in bash terms let `linux` be a builtin and I want to remove
`quiet` from all calls to `linux`. Since functions override builtins, I'd
just override it with a function:
linux () {
local arg args=()
for arg; do
[[ $arg == quiet ]] || args+=("$arg")
done
builtin linux "${args[@]}"
}
Is there anything similar in grubscript (not in the approach, but in the
result)? I tried to create `linux` function, but the command still
overrides it when called.
- Is there any way to intercept "linux" command call and change its args?,
Adam Vodopjan <=