Closed egorsmkv closed 8 years ago
By executing the entire file as sudo
$ sudo bish -r /root/bin/example.bish
This is how you would do it in bash as well, unless I'm misunderstanding something.
@noahmorrison I mean the execution of certain commands from the administrator.
@eg0r I'm confused, could you show me an example in bash?
Do you mean something like this?
sudo -u root $cmd
sudo -k
@noahmorrison Yes. Perform certain commands defined by the user.
Excuse me, I use a translator because I have weak English.
It's fine, I might play around with bash implementations this afternoon. I personally like the @root
more than the as root
. Running full blocks as a user might be something we look at as well.
@root {
@(yaourt -Syua);
echo("this is also run as root");
}
It would be wonderful.
Overall, this is a good idea. One thing is that the syntax should probably be '@su' for superuser instead of '@root'.
It would also be good to come up with a unified syntax for this and executing normal external commands. For example, we might do @su(...);
to match the @(...);
syntax. The idea of executing whole external blocks is good too, and it would be fairly straightforward to allow multiple statements within the parens, separated by semicolons.
@tdenniston Need to make the operator that selects the user, not just root.
E.g.: @root(...);
or @my-mom(...);
.
To execute multiple commands:
@my-dad {
cd(...);
# ...
}
I would like to ask how it will be implemented?
You can make a semblance of annotations:
Or like this:
This is a relevant question, I think, for many users.