| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8
Comments:
<0> yeah <1> I might have missed a response to my question. <2> OmiKrOn: $'#\tTEMPORAR' <0> thanks gc <2> (in BASH ONLY) <0> righto <0> working thanks <0> another question(or please direct me to the manual page), I can have 3 more different strings instead of TEMPORAR, any ideea on how to see/get rid of them in what line ? <3> hi all <3> What exactly this gives, echo ${var:?"MSG"} <3> bash: var: MSG <4> how to match a floating point number with grep? <3> What does this mean? <3> ROBOd: do you want a soltion <4> payal: yes <2> payal: man bash, parameter expansion
<2> payal: warning: 1) he's an idiot; 2) he wants the moon. <4> grep \d+.\d+ does not work <3> ROBOd: go to google: search for regular expresion, the first hit takes you to a page, in that the same example is given <3> precisely what you want <4> greycat: seriously, i have nothing against you. the fact i want a script is not a big deal <3> greycat: Yes I already checked out man page , it exits the scripts but ...... this is funny .. check out <2> ROBOd: just use rcs. <3> echo ${var:?"MSG"} > /dev/null 2>&1 <3> bash: var: MSG <3> strange nah! <2> you've been given MORE than your fair share of advice, hints, corrections, criticism, etc. <3> ROBOd: please do what I say, believe me <3> greycat: why is error not redirected to /dev/null <2> imadev:~$ bash -c 'echo ${var:?MSG}' 2>/dev/null <2> imadev:~$ <3> I tried redirecting all other fds also, none of them waork <2> it's probably like "time". <2> !faqtime <5> http://wooledge.org/mywiki/BashFaq#faq32 -- How can I redirect the output of 'time' to a variable or file? <6> Futter? <3> greycat: if you are right this time too, I will give you a saucer of milk <3> thanks greycat <0> another question(or please direct me to the manual page), I can have 3 more different strings instead of TEMPORAR, any ideea on how to see/get rid of them in what line ? <3> OmiKrOn: ? <3> greycat: are you using openbsd <0> i have this grep $'#\tTEMPORAR' /etc/dhcpd.conf | cut -f 2 <0> i want to match another strings except TEMPORAR <3> -v <3> grep -v <0> -v is invert <3> so that is what you want <0> no <0> ok lemme use pastebin <0> http://rafb.net/paste/results/EmmZLt17.html <-- i want to match TEMPORAR MAC VECHI and NEPLATA <3> OmiKrOn: you want to match all line having those words? <0> yeah <0> a direction to the right man page should be fine tho' <4> is there a way to output from grep the regular expression group i just matched? <3> what is wrong with egrep '(foo|bar|sar)' fname <4> not the entire line which matched <3> you can store the values in variable and maybe used sed <3> sed "s/\($var\).*/\1/'" <4> i have grep "version = \([0-9]\+\\.[0-9]\+\);" index.js <3> sed "s/\($var\).*/\1/" <4> which nicely works, however i'd like grep to just output the content of the first group, not the entire line <4> like i can do in php, perl, whatever ... using $1, $2, $3... <3> ROBOd: grep cannot do that, you have to use sed <3> grep outputs the whole line <4> too bad :( <4> i don't wanna do any search and replace <3> why not use sed <3> hmmmmmmmm <4> payal: well ... can i send \1 to a script? or can i directly increment it with sed? <4> the number <3> decrement what? <4> i was thinking along the lines of using grep to match the floating point number, then increment, then use sed <4> ... increment the number <3> wait I am getting confused betwween you and OmiKrOn
<4> np <3> ROBOd: did you see the site I told you <4> payal: yes <3> did you get a solution there <4> payal: actually, i know regex, i used it quite enough <3> ok <4> payal: thing is i don't know what grep is capable of doing with regex <7> hi <7> mv /tmp/123 /backup/trfw/ <7> mv: failed to preserve ownership for `/backup/trfw/123': Permission denied <3> ROBOd: not much but egrep can do better <4> payal: yes, i found the solution <4> uhm... <7> it exits with 1 which ****s ;) <7> i am trying to copy it onto a samba share <3> spiekey: maybe you don't have write perms on directory trfw <4> i couldn't figure out the difference between grep and egrep <3> ROBOd: egrep uses ERE and grep uses BRE <3> I always use egrep instead of grep <7> payal: i do! <3> what are they? <7> payal: it copys the file fine, but fails to set its mod <8> ROBOd: grep(1) can have problems with non-ASCII files. egrep(1) handles files with non-US characters in it much better. <4> thanks MiniMax and payal <4> and apologies if i am annoying <4> yet, no apologies to gref*cat :) <7> payal: a touch works fine on the destination dir <3> hmmmm <3> not sure spiekey <3> sorry <2> payal: the box that hosts the wiki is OpenBSD <9> how to do math in bash ? <9> n=1; n+1 doesn't work :) <1> I forget... is there a command to generate ranges like `range 1 6 2` outputting "1 3 5"? <2> !math <5> http://wooledge.org/mywiki/ArithmeticExpression <1> or wait... I guess I can use arithmetic too. <3> a=8 <2> for ((i=1; i<=6; i+=2)); do ... <3> b=9 <3> let c=a+b <1> greycat: thanks. <3> brb <9> thanks, greycat + bot <4> yo, playas <4> i got the version number with sed and ghrep <4> *grep <10> Go away. <4> how to increment it, lol? <10> Increment what? <8> !arithmetic <10> !math <5> http://wooledge.org/mywiki/ArithmeticExpression <8> Damn - I was soooo close. <2> 12:55 greycat> if you're VERY CLEVER, you might be able to do the EXTRACTION with sed. then, incrementing the version number is a Hard Problem. Then, writing it back into the file would require an editing-type operation. hence ed(1) or patch(1) or something that can edit files. <10> heh. <4> thanks guys <11> short of invoking patch within a script is there an easier method of inserting text into the middle of a file? <2> 12:49 greycat> now THERE is a reasonable answer, in the middle of all that prose: use a versioning system. <2> 12:53 greycat> CVS is just a network layer around RCS <2> 13:03 greycat> ROBOd: just use rcs. <8> trelane: perl can do it. <4> greycat: in worst-case scenary i will use !/bin/perl or php :) <4> *scenario <2> I'm sure that will work SO much better than keeping your important files in a version control system. Oh, yes. <8> ROBOd: Be our guest. And *do* come back and tell how you did it. <4> greycat: i backup my data on a daily basis <4> MiniMax: you want me to tell you guys how i do it with bash? or perl/php? :) <2> ROBOd: feel free to bother #perl or #php instead. <12> hehe <4> greycat: i will not do so, lol :P <4> because i already know how to do it in perl/php <2> Would it help if I sugar-coated it? "I feel that you have exhausted the supply of advice we are capable of giving you." <4> it's just more fun talking to you guys :)
Return to
#bash or Go to some related
logs:
phyton xubuntu ubuntu mozilla-mplayer totem-mozilla aralion linux ars106s fedora setxattr EOPNOTSUPP #suse #debian debian disable firewall /usr/src/modules/fglrx-kernel/fglrx/build_mod/2.6.x char * from python object #ubuntu
|
|