« first day (1420 days earlier)   

12:31 AM
I remember somewhere a discussion about "define this word in this context" and I remember that they were off topic (OP should read wikipedia or a dictionary instead), anyone remembers something about UL? unix.stackexchange.com/questions/152702/…
 
 
6 hours later…
6:26 AM
@FaheemMitha a couple people
sorry I never replied
I went to bed
@derobert hush now
I wanted something really old
@FaheemMitha all this week, yes
Saturday through Sunday
@derobert I'm the magic man
 
 
2 hours later…
8:41 AM
@Braiam what's important is which one has the best answer. We can improve the title.
@Braiam it's off-topic here because this isn't a technical word related to unix.
On language sites, “define this word” is usually off-topic, but “define this word in this context, the dictionary definition makes no sense to me” is on-topic.
 
9:12 AM
@strugee So, how are you enjoying Debconf?
 
 
2 hours later…
11:19 AM
10
Q: What environment do I get with sudo?

tjamesonWhen I run sudo, what exactly happens to my environment? When I run sudo command, it doesn't seem to see my or root's environment. For example, my path for both includes /usr/local/bin, but if I try to run one of the program's without the full path, it fails. I thought sudo ran as root, and hen...

The answers could be better.
 
11:34 AM
If I am running a script as sudo, and I want the $HOME used to be that of the user, can I stick it in the script?
 
how to remove a newline character in a particular line through perl?
@terdon ^^^
@mikeserv
 
 
2 hours later…
1:22 PM
HI..
@Gnouc
thanks for your effort, i figured it out the problem...
get your 15 points..
 
You're welcome :)
 
 
1 hour later…
2:58 PM
@Gnouc r u there?
 
3:15 PM
@AvinashRaj: Yeah
 
did you know about PCRE dotall modifier (?s) ?
example. My file looks like the below
foobar1
barfoo
foobar1
foobar1
foobar1
gadjjjdjj
 
you mean dot will match all character, in clude newline?
 
yep.
this regex would match the last foobar1
(?s)foobar1(?=(?:(?!foobar1).)*$)
i want to add a \n bar foo after the last foobar1.
 
@strugee if you run into Russ Allbery, say hi to him for me. He's a great guy.
 
@AvinashRaj: So you have problem with that?
 
3:21 PM
what i tried is,
perl -00pe 's/(?s)(foobar1)(?=(?:(?!foobar1).)*$)/\1\nfoobar/' file
it works and prints
foobar1
barfoo
foobar1
foobar1
foobar1
foobar
gadjjjdjj
but if my input contains a blank line, it adds the foobar next to the last foobar1 line
 
@strugee he's just moved to Dropbox from Stanford.
 
example:
foobar1
barfoo
foobar1

foobar1
foobar1
gadjjjdjj
command:
perl -00pe 's/(?s)(foobar1)(?=(?:(?!foobar1).)*$)/\1\nfoobar/' file
output:
foobar1
barfoo
foobar1
foobar

foobar1
foobar1
foobar
gadjjjdjj
did you notice that? I think it's because of paragraph mode.
 
I think it's because your regex
 
you mean my regex is wrong...?
 
you will replace if the next line does not start with foobar?
 
3:31 PM
no, it won't work.
 
Ah, I got it
paragraph mode problem !
use:

perl -0777pe 's/(?s)(foobar1)(?=(?:(?!foobar1).)*$)/\1\nfoobar/'
 
what is -0777?
let me check.
 
Any value 0400 or above will cause Perl to slurp files whole, but by convention the value 0777 is the one normally used for this purpose
 
works..
 
Hi guys , using cygwin how can I restrict a user to connect to a specific folder
I already set the SFTP user, but he connects to the home
 
3:34 PM
@AvinashRaj: 0400 to 0777 causes perl slurp file, but not turn on paragraph mode :)
 
I need to change to /cygdrive/d/
 
Does anyone know of a ADSL router which has free firmware available for it?
 
@Gnouc i think (?m) won't work while using -0777.
multiline modifier
 
(?m) is diffrent with (?s)
 
does anyone know the answer to my question
 
3:37 PM
@AvinashRaj: (?m) causes ^ and $ match the start and end of string, when string is breaked into multiple line
(?s) treat string as single line, cause . to match newline
 
yep,
i know regexes very well. But i don't know how to implement it in perl. Now i got that.
 
@meda did you post a Q on the main site?
this isn't the place to ask questions. Its a great place to discuss them though
 
@Gnouc what is chomp?
is that same like -0777?
 
@AvinashRaj: No, in Perl, chomp often use to remove the newline from the end of input
You can perldoc -f chomp to read more details
 
@casey I saw few duplicates, but they are not working for me
should I post a question?
 
3:50 PM
i think we no need to use start and end anchors , modifiers in -0777 mode. Am i corrcet?
 
@meda if none of the questions are true duplicates, then post your Q, however it is good to mention the near-duplicates and why your Q is not a duplicate in the Q
 
@AvinashRaj: It depends on your requirement
 
it works with or without (?s) in this command
perl -0777pe 's/(?s)(foobar1)(?=(?:(?!foobar1).)*$)/\1\nfoobar/'
 
@casey I know what you mean , sometimes I just need quick pointers, for instance I just found out the answer by checking an answer online
 
@AvinashRaj: (?) only cause dot . matches any character, include newline. ^ and $ have no affect.
 
3:57 PM
I now have a new question tho, how do restrict the user from changing directory.
I am so sorry to ask it here, if its complex I will post a new qestion
 
Thanks. Bye..
 
@AvinashRaj: You're welcome!
 
4:29 PM
@AvinashRaj - yes?
 

« first day (1420 days earlier)