| |
| |
| |
|
Comments:
<0> utmp is not text on most systems. <0> sed would be hard-pressed to edit it. <1> yep :/ noticing that
<1> im doing it in gawk now <0> The only semi-portable way to edit it is using pututline(). <0> But utmp is one of those inherently non-portable UNIX things. <0> Why not let getty/sshd handle this? These programs do this automatically. <2> Hm, I want to add an x to the front of all the files in a dir if it ends in _th.jpg ... if not, then don't add an x. I currently have this: for x in *; do new=$(echo $x | sed -e "s/_th//" -e "s/^/x/"); echo $new; done ... but that adds an x to the beginning of everything. How would I specify to only add an x if there is a _th.jpg or a _th in the filename? <3> for i in ./*_th.jpg; do echo "x$i"; done <4> hi if i have a file with "1.\r\nsomething\r\n2.\r\nsomething" etc <4> and i want it to be 1.something\r\n2.something <4> how can i do it <5> Hello... <5> I want to replace ***ERT(( ... )); with ***ERT( ... ); (C-Code) ... may be multiple lines long. I allreadyy tried "s/***ERT(\s*(\(.*\))\s*);/***ERT( \1 );/m" as the info page states that m makes s run over multiple lines. But that still only catches one line ***ERTs. <0> jok-: With what tool?
<5> Did I forget something or is there another way to do it? <3> sed -e 's/\\r\\n//1' -e 's/\\r\\n//2' <3> Although, I'm sure there's a much nicer way to do that. <5> goldfish: Was that for me? <0> arg. I thought I was talking on #regex. "What tool?" is a stupid thing to ask here. <3> hehe <3> devurandom: no <0> jok-: First, sed typically is only happy with text input. <0> jok-: If your system is DOS or Windows or VAX or ... somesuch system ... it will deal with \r\n automatically. <0> jok-: Otherwise, it's easier to convert your input file to UNIX format, then munge it with sed, then convert it back. <0> jok-: That said: /[.]$/{N;s/\n//;}
Return to
#sed or Go to some related
logs:
gradiants howto iirc xchat2 gentoo #awk versioning file system* xp OR windows kdebase3-SuSE gentoo pl2501 linux 3840x1200 wallpaper dlname not found libphp4.la mount img.toc #php
|
|