« first day (106 days earlier)      last day (2293 days later) » 

9:15 AM
it started snowing
 
 
12 hours later…
9:28 PM
@Zanna Since we've been discussing shells... Do you have any insight into this? I mean, it seems obviously wrong. until tests before each iteration, just like while does, not after. But it's posted by an experienced shell scripter and upvoted thrice! (I'm talking about the comment, not the answer. I've upvoted the answer.) Am I missing something?
Well, I've commented.
 
$ set -x
$ while sleep 1; do echo argh; done
+ sleep 1
+ echo argh
argh
+ sleep 1
^C
zanna@toaster:~$ until ! sleep 1; do echo argh; done
+ sleep 1
+ echo argh
argh
+ sleep 1
^C
(no I have no insight. But even on U&L people sometimes upvote silly things.)
(and everyone has silly thoughts)
@EliahKagan maybe you will solve the mystery then :)
 
9:44 PM
This doesn't sound right:
> In the versions of bash and sudo I have with kubuntu lucid, sudo cd now works – without any workarounds.
How??
 
$ sudo cd /boot/efi
[sudo] password for zanna:
sudo: cd: command not found
well it doesn't work for me XD
 
How could it!
 
I can't imagine
maybe sudo echo foo > /rooty/place also works without workarounds in mysterious versions of Ubuntu
 
lol
 
where sudo silently starts a root shell and runs the requested command in it
 
9:49 PM
But sudo wouldn't see the words > and /rooty/place so how would that work?
There is also the matter What I should have actually said was that sudo is not actually run in that situation. The shell stops when the redirection fails.
ek@Io:~/pl$ echo 'It runs!' 2>/root/yplace
-bash: /root/yplace: Permission denied
 
it would capture whatever you typed always in the background so that if ever you called it, it would retrieve the keys logged and reconstruct the command for you... or something
@EliahKagan I hadn't realised that :)
 
Is it worth commenting on that answer? The other answers clarify explicitly why sudo cd can't succeed and that answer doesn't appear to attempt to explain how it possibly could. It's also about an old system the author is not likely still to have.
OTOH I'm reluctant to downvote it without commenting because people might interpret the downvote as disagreeing with the part about how it can be okay to use su. It is true that it can be okay to use su.
 
it has one anonymous upvote
so maybe someone else has that magic version of Ubuntu where sudo reads your mind and does what you want
A comment might help... at least passers-by might be slightly less baffled
 
10:14 PM
@Zanna Well, unlike with redirection, it should be possible to write a sudo script or shell function that treats cd specially and starts a new root shell for it.
 
maybe such a script could be an answer to this question :)
 
:)
phew!
less astonishment
 
That's what I was thinking!
Do you feel like posting an... Okay, I'll do it.
 
10:30 PM
:D
 
10:50 PM
yes MestreLion,700 will not stop root from enterting. Permissions '000' will stop the user from entering himself (yes, a user can create a dir he himself can not enter...) but still root can enter that one. — Rinzwind Aug 20 '11 at 6:28
TIL
zanna@toaster:~/playground$ mkdir nope
zanna@toaster:~/playground$ chmod 000 nope
zanna@toaster:~/playground$ sudo -s
root@toaster:~/playground# cd nope
root@toaster:~/playground/nope# exit
exit
zanna@toaster:~/playground$ cd nope
bash: cd: nope: Permission denied
I assumed this would not be the case, since root can't execute regular files that don't have execute bits...
 

« first day (106 days earlier)      last day (2293 days later) »