| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Comments:
<0> CarlH: egrep -o "test" file <1> Ok one prob <1> I want to basically mask --- and show only the mask <1> for example <2> CarlH, redduck666 gave a good example. Maybe combine with the -n option and and your expression with /gp if you only want to print lines that match <1> '^.*?([0-9]+).*?$' <1> I dont want to print the whole line -- just the masked part <1> so in above example, anything output would be numbers <1> but if I tried the above, I would get the whole line <0> no, you use -o option for that. <1> explain <0> man grep <3> What distro do you people like? I did research, and took the test at http://www.zegeniestudios.net/ldc/ and I don't like any I've seen. My main requirement at this point is that it must have NTFS support because I want to dual boot with windows without changing the to FAT. <4> CarlH: sed -ie 's/^.*?\([0-9]+\).*?$/\1/g' <3> Oh, and it must be free. <0> CarlH: man grep | grep '\--only-matching' -A 2
<4> CarlH: you`ll need <file> at the end of that regex. <5> KingDillyDilly: you can always dual boot to windows without changing the FS to FAT <5> I mean, I run a Windows dual boot... Windows running NTFS, Slackware running on reiserfs... support for NTFS read is good <4> CarlH: and like i told you some time ago and like dimir is telling you right now, grep`s -o option is your friend :) <5> as for captive NTFS (which gives NTFS write support on Linux)... I haven't figured it out, but at least they work in a dual boot, and that's good enough <5> most Linux distros are free... there are very few that are not <3> http://fedora.redhat.com/docs/release-notes/fc4/errata/ "NTFS Support is not included in the Fedora Core kernel because of patent concerns. Using a file system natively supported by Linux such as ext3 is a better option. If you must share files between Windows and Linux on a single system, use FAT/FAT32 (vfat) instead." <1> thanks redduck666 <5> KingDillyDilly: you can easily recompile the kernel :) <5> I wouldn't recommend fedora though <5> that distro, unlike others, is being a real pain by taking way too much unneeded precautions and doing stuff in a weird way <1> sed: -e expression #1, char 29: Invalid reference \1 on `s' command's RHS <5> eg. I personally avoid it due to its unwillingness to recognize Taiwan as a country (though by standards it's not... but most other places separate it for sakes of simplicity) <3> I wanted to choose Mandriva (I don't know Linux) but their IRC channel is a little slow and some stuff isn't free and I found it hard to determine what. <1> redduck666: any idea why? <5> in any case... yeah, NTFS support is in the kernel - an OS doesn't have it? recompile the kenrel <5> KingDillyDilly: I'd recommend ubuntu for you <5> it's basically an easy distro based on Debian :) <5> as for free - it doesn't get much more free, they'd even ship you a CD for free <4> CarlH: well, my sed doesn`t complain. <1> It doesn't seem to be \1 or \\1 --- when I do sed -ie 's/Test/\1/g' file.txt <6> back <1> \\1 doesn't complain -- but doesn't work either :) <5> mandrivia is mostly free... but that stuff is pure junk IMHO <7> hmmmmmmmmmmmmmmmmmmmm, time for some peasoup!!! <4> CarlH: errrr, s/Test/\1/g, you`ll have to create back references first. <1> explain, ya lost me <4> CarlH: back references would be the things between \( and \) <1> ahhhh <1> \( and \) rather than () <5> through my years of experience of different Linuxes... my three top recommendations would be: ArchLinux, Slackware, and Debian <3> Ubuntu is kind of new and they spend too much time on language support, but I'll reconsider it. <5> just because a distro is new doesn't mean it ****s... as for language support - that's just an extra feature that you don't have to use <1> hmm still not working, no error now just no output <1> sed -ie 's/\(TEST\)/\1/g' file.txt <5> ubuntu is basically debain with some modifications to make it newbie-friendly <0> CarlH: when you use \1, that is a reference to the string in parantheses () from the first patter. <0> s/patter/pattern/ <0> CarlH: in the 's/Test/\1/g' there is no such thing. <0> CarlH: try this: echo helo | sed 's/.*\(el\).*/m\1on/' <0> rtfm damn it <6> I used to use Ubuntu. <0> :-) <0> wow, lag! <5> as for archlinux and slackware... those are really to the point, but you'll be compelled to learn to use them <4> CarlH: what you wrote would replace 'test' with itself :) <5> KingDillyDilly: so, what kinda distro are you looking for exactly? <4> dimir: can you explain why quantify-ing doesn`t work: <4> yos@yos bak $ echo "akbdfca6777aksb" | sed -e 's/.*\([0-9]+\).*/\1/g' <4> akbdfca6777aksb <4> yos@yos bak $ echo "akbdfca6777aksb" | sed -e 's/.*\([0-9]\).*/\1/g' <4> 7 <8> Try escaping the +. <1> redduck666: I am trying to output the file such that only 'Test" displays <1> but I did create \( and \) and still not working: <1> sed -ie 's/\(TEST\)/\1/g' file.txt <8> CarlH: Did you try looking at the man page yet? <9> that is weird.. <4> ignacio: nope, escaped +, outputs simply '7' <4> CarlH: lemme repeat what i said, you command will do NOTHING. <4> *your
<1> I get that, what I dont get is how to modify it so that it does --- <4> it is probably issue with greedy matching :/ <8> I believe so. <3> I'm going to buy http://www.apricorn.com/product_details.php?ID=333 for backups, and I figured I'll take advantage of the extra space and install Linux. No immediate plans for how I'll use it, but I'll probably install Perl modules that require C, which are a headache in Windows. <5> do you function well with a command line, and are you a good learner when it comes to computer stuff? <4> ignacio: any ideas how do i prevent it? .*\? doesn`t seem to do the trick, and neither does .*? <3> Yes, I'm a good enough learner and patient, but I like good instructions that don't ***ume I know stuff. For a programmer, I don't know much. <4> CarlH: grep -Eo 'regex' your_file <8> [^0-9]* <9> yeah i tried that <9> echo "akbdfca6777aksb" | sed s/'^[^0-9]*\([0-9]+\)[^0-9]*$'/'\1'/g <9> <-- didnt match at all.. <5> KingDillyDilly: then something like Arch or Slackware might be perfect for you <10> W00t, I just broke into google.com <10> Turns out to be a beowolf cluster. <10> My uber 1337 skills did it again. <10> Fear me. <10> muahahahaha <3> I heard good things about Slackware a couple of years ago. I'll look at it again. <11> google.com is huge <5> since those, while not the easiest, are easy enough (I've taught a few friends how to begin on those)... they don't try to impress you, but they function very well <12> the moloch must die <11> probably multiple clusters <10> Kevin`, it's not that big. It looks big, but it's not. <3> I heard it's hard, but of course, their website argues against it. <12> did you deface it? <10> No <5> Slackware is constantly improving - main complaint I have is the amount of work you have to go through to install stuff <10> I'm not a script kiddie. <1> redduck666: When I do it using grep -Eo --- would I do this: grep -Eo 's/.*?(Test).*?/\1/g' file.txt ? <5> archlinux is very similar to slackware, except you have a packaging system <4> yos@yos bak $ echo "akbdfca6777aksb" | sed -e 's/[^0-9]*\([0-9]*\).*/\1/g' <4> 6777 <4> yos@yos bak $ echo "akbdfca6777aksb" | sed -e 's/[^0-9]*\([0-9]+\).*/\1/g' <4> akbdfca6777aksb <4> can anyone explain the above behaviour? <5> redduck666: would you please use pastebin <4> CarlH: no, grep -Eo 'test' file <12> redduck666: http://sitescooper.org/tao_regexps.html <4> excelblue: maybe i should, but i`m kinda feeling stupid to pastebin 4 lines :) <12> maybe it doesnt support all regexp stuff <5> anything over 2 lines warrants a pastebin IMHO <13> I'm looking for a good family distro that can run on 667Mhz Cpu and 128Mb ram. <11> family? what do they do <0> redduck666: * is trying to get as much as possible, and since '[0-9]*' means even zero matches, the '[^0-9]*' '.*' take everything. <14> bulio|: I've never used it before, but maybe Debian? Fedora? <11> word processing? ;) <13> Internet browsing, occasinal word processing, music <5> bulio|: what do you mean by family distro? something that a family can easily use? <11> I like debian.. I think it would be fairly easy to learn how to USE it <3> ..off to eat. Thanks for the help everyone <14> excelblue: understand that its your window manager that essentially makes it family-usable, not the distro itself <14> you can run OpenBSD <0> or... <14> but if you use KDE, then its all good. <5> I'd personally go for a slim distro and configure it so others can easily use it <11> i'd have someone smart do the updates and system management stuff <5> KDE - not for 667MHz computers... <13> I use debian with KDE on my PC <14> fluxbox? fvwm? whatever you can get your family to go along with <5> for a slower computer, I found out that most people can easily figure out the quirks of fluxbox <13> 570Mhz cpu 380 mb ram <13> XFCE is what I'd like for them <0> redduck666: no, that's not it. :-) <5> fbdesk + fluxbox - very easy... xfce is very good too <4> dimir: but [0-9] takes excatly 1 match, even tho it is "0 or more", while + takes all the numbers even tho it is "1 or more" <5> bulio|: what's the processor? (is it P2) <4> errr "but [0-9]* <13> Celeron <4> " <5> since if it's a Pentium2 (not VIA Cyrix, AMD K6), an i686 distro such as arch might be good <13> I didn't like arch <0> redduck666: there you go: echo "akbdfca6777aksb" | sed -r 's/[^0-9]*([0-9]+).*/\1/g' <1> redduck666: If I do grep -Eo 'test' file --- then I dont acheive my goal, which is masking a string (per line) and outputting only what is \1 relative to that mask
Return to
#linux or Go to some related
logs:
modprobing in ubuntu ubuntu pt800ce audio #math automatically synchronize remote mail locally #suse #css delete mailq deffered queue postfix
xen+mandriva+veth1 #perl ATI Rage LT Pro AGP xorg dri
|
|