« first day (1443 days earlier)      last day (3519 days later) » 

6:37 AM
$ perl -pe 's/(?<!\t|^)"(?!\t|$)/\\"/g' file
Variable length lookbehind not implemented in regex m/(?<!\t|^)"(?!\t|$)/ at -e line 1.
How i make the above command to work?
 
 
5 hours later…
11:56 AM
Is there some easy way to see file permissions in numerical form, like 755?
 
 
3 hours later…
2:42 PM
@FaheemMitha stat -c "%a %n" /path
 
2:52 PM
@Ramesh Thanks. This was an question on AU, and there were a couple of answers, which surprisingly, were correct.
Sorry, I couldn't resist. :-)
54
Q: How can I get octal file permissions from command line?

Anwar ShahThere is a chmod command to set file permissions, but can I get file permissions in octal mode (such as 755) from the command line?

 
3:24 PM
I'm seeing this on apt-get update. Anyone else?
> W: Ignoring Provides line with DepCompareOp for package libuv-dev
 
@Braiam Thanks
 
@FaheemMitha: See my answer askubuntu.com/a/526740/323845
 
@Gnouc Doesn't work with directories.
 
@FaheemMitha: Strange, how did you know that? What did you try?
 
3:35 PM
@Gnouc I did.
 
@FaheemMitha: Can you give an example?
It must work normally with folder too
 
@Gnouc I tried it with a random directory. It gave 0000
faheem@orwell:/tmp$ perl -e 'printf "%04o %s\n", (stat())[2] & 07777, $_ for @ARGV' mode
0000 mode
faheem@orwell:/tmp$ stat -c "%a %n" mode.orig/
755 mode.orig/
 
You give mode as argument?
not mode*?
 
@Gnouc You're right, I used a non-existent directory. With the correct directory it gives the right answer. Still, your code should probably complain if the file or directory does not exist.
faheem@orwell:/tmp$ stat -c "%a %n" mode
stat: cannot stat `mode': No such file or directory
Unix tools are good at that.
 
3:58 PM
@FaheemMitha: Updated! And perl is also a Unix tools :)
 
@Gnouc It is? What about portability then?
 
@FaheemMitha: Almost modern Unix system has perl as default, and perl can run almost anywhere
 
@Gnouc Even windows?
 
stat is only on GNU Linux
 
@Gnouc Oh, I didn't know that.
 
4:05 PM
@FaheemMitha: I haven't tested in Windows.
 
@Gnouc No, i meant, is perl available natively on Windows?
 
@FaheemMitha: Yes, perl can run on Windows, via ActivePerl or StrawberryPerl
 
@Gnouc I see. So, really portable, then.
 
4:52 PM
Weird, I'm being threatened by english.sx.
Wait! Some of your past questions have not been well-received, and you're in danger of being blocked from asking any more.
 
5:10 PM
What is that SE extension that lets me see up/down votes? and is it easy to enable?
 
@FaheemMitha search for post vote breakdown
 
@Braiam ok
 
 
3 hours later…
8:20 PM
@FaheemMitha you know something that do this?
 
9:11 PM
@Braiam I don't think anything like this exists. At least I have never heard of it. And thsi question might be a better fit on tex.sx.
TeX isn't the kind of thing that lends itself to wizards.
 

« first day (1443 days earlier)      last day (3519 days later) »