You are not logged in.
Pages: 1
currently if you type $pacman -S package it will spit back error: you cannot perform this operation unless you are root.
Does anyone know a way that I can catch permission errors and instead of giving the error just prompt for root password or something similar?
Offline
Moved topic....
Look into setting up sudo and making an alias on the wiki
Offline
Yea... one could do that but that would involve a lot of aliases for what I was asking. Perhaps I could clarify a bit more by another example. Say I run $touch /sbin/somefile again I get a permission error... How would one change this behavior to instead prompt your for the a password or even username/password. Any ideas?
Offline
alias s='sudo'
alias p='sudo pacman'
p -S package
s touch "some dirty file"
s less /var/log/auth.log
Sudo is then just two-characters away from being automatic.
Last edited by Wintervenom (2010-06-23 07:15:47)
Offline
Offline
Yes... Login and work day-to-day as root.
Permissions and sudo are there for a reason, and coming up with some system to automatically override them makes them completely redundant.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
He's just asking for an automated way of asking password.
How would it make 'permissions and sudo' 'completely redundant' is far from my understanding.
Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !
Offline
I personally wouldn't recommend catching it and automatically asking for a password, but if you really don't want to retype everything, you could always do:
$ sudo !!
There's a lot you can do with bang commands, so check them out.
Offline
You could also look at using super as an alternative to sudo for certain tasks.
All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.
Offline
You can use Yaourt instead of pacman. You can use it with the same syntax as pacman, but it will ask for a password if needed. It also has tons of other nice features, including but not limited to being able to install from AUR.
You can get it from AUR or from the archlinuxfr repo. Just add
[archlinuxfr]
Server = http://repo.archlinux.fr/x86_64
or
[archlinuxfr]
Server = http://repo.archlinux.fr/i868
depending on your architecture, to /etc/pacman.conf, then you can install it from that repo.
Last edited by lastchancetosee (2010-06-23 22:06:20)
My ship don't crash! She crashes, you crashed her!
Offline
I don't suggest using yaourt, because it's a lot slower than normal pacman and (I think) isn't being actively developed.
Offline
I don't confirm that. Right now there are new yaourt packages and the performance improved A LOT. Give it a try.
.::. TigTex @ Portugal .::.
Offline
Be nice to able to catch the permission error and then sudo !! automatically. Eh o well it is not a big deal. Just hate retyping . Did not expect so many people to get their panties in a wad though. Wonder if they even read the question... or if they were just trying to troll.
Offline
correct me if i'm wrong but the shell gives you your error messages depending on what the program/action returns/exits with. if you wanted to catch these error reports you'd have to be monitoring for them constantly from within a shell function (perhaps ran before every command is executed from that shell) and have it respond according to the error (in your case, maybe just watch for permission errors).. i guess read the manpage for your shell to give you ideas on the errors returned to give you a better idea on how you want to handle it, because it sounds like a lot of work just to reduce the amount of time typing your password. i dunno i'm probably all wrong
Offline
@op
I recommend timestamp_timeout = 0
Offline
Pages: 1