| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8
Comments:
<0> yup <1> and I'm probably talking to a channel full of people who have never actually *compiled* perl themselves.... <0> not true. :) <2> greycat: I am impressed with your grasp of the English language and your williness to show everyone else how witty you are :) <3> trash: ok so i can do something like "find / -name testfile", but how do i properly pipe it to dirname? <1> hedpe: man find <0> whats really fun is building perl modules just for specific C interfaces <4> hedpe: look at the FAQ, there are plenty examples. <5> <5> GNU find has -printf and ... mh ... %h? <0> DanBrwn_: greycat gave you the correct info. <1> hedpe: ignore the part about dirname, and substitute -path <0> DanBrwn_: You appear to need to use perl for whatever it is you are doing at the moment. <4> ah, -path. sure. <2> Thanks all ! <0> You're welcome! :)
<5> -path? i think he asked for getting the dirnames of files that match a specific pattern <1> well, he asked 2 different questions. <1> and I wouldn't be at all surprised if both of them failed to express what he actually wants to do <5> oh <3> greycat: i don't see how -path could help me... i want only a list of the directories that the file i am looking for is in <1> so chop off the directory name in the find(1) output <1> err, chop off the filename, leaving just the dir name <3> greycat: theres no way to pipe it to dirname or something? <6> hedpe: find . -your-criteria - print0 | xargs -0 -i dirname {} <6> hedpe: or you could use find -exec ... <1> or sed, or awk, ... <1> c'mon, THINK! <5> hedpe: is it GNU find? <7> anything else I can do to clean this up a bit? <7> http://pastebin.ca/168128 <6> beikangyao: without knowing much about your data/files, it looks reasonable <4> deja-vu. <8> hey ya! <8> oh dear.. i'm really stuck with saving a date (date +%F) to a variable... <8> any hints? <9> var=$(command) <8> that was easy <8> thank you! <8> another thing: i want to create a little backup script that pushes data to a mounted share. there is really no need to use rsync for this, is it? <8> as the rsyncd would run on localhost... make no sense to me? any suggestions? <10> hrmm ... any one have a clue on what one might search a index.html file and replace the windows character code for TM (ie: what is the code which i can use regex to search and replace with html entity code ...) <11> rs: utf-8 encoded? <12> PepperBob: rsync -cavz "$SOURCE" "$DEST" You don't need rsyncd for that. <10> umm well i think my shell (where i'm scripting this search and replace) is utf-8 encoded but ... <10> the actual html source (which i can't change :\) <8> wonderfrog, is there any advantage compared with just using cp? <11> rs: if so, just sed -e 's/character/\&lol;/g' should work <10> sure i am using a perl version of that command <10> to do the job but i'm not sure what character (or end character code) i can put in the 'search' field ... (to represent the windows character TM) <11> rs: use the literal tm character <12> PepperBob: Yes. Read the man page for rsync and look for the options --checksum and --archive. But, of course, you can always use cp if you prefer. <10> i've tried copy and paste, yet the symbol for tm does not seem to be viewable or pasteable (i know this is a murky issue an all ... but i'm tryin to find a solution) <7> <sup>(TM)</sup> <10> again i'm trying to search for a character that does not apear to be supported in non-windows character maps? -=-> " <8> wonderfrog, thanks. so i think i'll take the rsync thing. looks safer. <7> Latin-1 char set says 153 <1> and what happens if your program is run by a user in the ISO-8859-2 locale? Or UTF-8? <7> it says keycode 153 is displayed in the browser as the raised TM <11> http://folk.ntnu.no/vidarhol/lol.png <13> guys, I have a bunch of directories, all with names like "dira.172.16.55.2" , "dirb.172.16.55.2" <13> can I rename all this directories with bash <9> You can. <13> could you tell me how? <0> heim see "man rename" <13> I think I would need to use something like "for each dir in /mydirs ; do" <4> heim: for i in /mydirs/*; do .. "$i"; done <1> cd /mydirs; for dir in */; do ... <4> err, yah <0> heim: part of the reason no one is giving you a specific answer is that you didn't tell them how you want to rename the dirs <1> depending on what he wants to do <13> I need to change the IP of the names of the dirs <1> !faq rename <14> http://wooledge.org/mywiki/BashFaq#faq30 -- How can I rename all my *.foo files to *.bar? <7> ™ is the HTML version of . the trademark character. <7> &trade; is the HTML version of & #153; the trademark character. (no space)
<0> heim: give a before and after examplke <13> before: dira.172.55.55.3 <13> after: dira.196.55.55.2 <13> I have LOTS of dirs like that <0> so - change every instance of 172 to 196, but only if it occurs in the first octet? <13> no, because in some cases, it says the dns instead <0> sounds like you need to treat them as two different cases <13> like, "diro.smtp.fer.com.us" to "diro.196.55.55.2" <13> I need to change what it says after the first dot <13> of every dir, no matter the pattern <0> heim, can you scriptually determine what to change it to or are you actually asking for something that will prompt you to enter the new name (after the first dot) in for each one? <13> I can determine what to change <13> I have a bunch of dirs called "dira.SOME.IP" <13> I need to rename this dirs from "dira.SOME.IP" to "dira.MY.NEW.SHINY.IP" <5> if you have the rename(1) installed that uses perl expressions... <13> from dira-to-dirz <10> koala_man, thank you for the hope, i'm looking now to find how to set or change my shell's current locale <11> rs: if it's a one time thing, use a proper editor and search/replace <10> koala_man, sigh, i've used emacs,vi, and had best results (ugg) with pico :\ <10> ok so my shell set|grep LANG says --> LANG=en_US.UTF-8 <0> heim, how do you getermine the new part of the name? <0> s/g/d <13> for f in * ; do echo "$f" "${f%.mail.myhost.com}.10.10.10.110"; done <13> it returns "dira.mail.myhost.com.10.10.10.110" and it should return <13> "dira.10.10.10.110" <0> heim - they all get the same ip? <13> yes <0> heim, they will all get 10.10.10.10 as their new ip? <13> affirmative <13> 10.10.10.110 <0> heim: try echo ${f%%.*} <0> that may help <10> hrmm ... so why did this command work and what were can i find a map of the \nnn codes? (f2.sh is a wrapper for search and replace) ./bin/f2.sh '\251' '©' <0> you can work the rest out <13> awesome bronze <13> thanks <1> man ascii <1> man iso-8859-1 <1> man utf-8 <0> heim: I quit! <1> man locale <1> man 7 locale <1> That might get you started. <0> !answer <0> !faq answer <14> No matches found at http://wooledge.org/mywiki/BashFaq <0> !faq file <14> http://wooledge.org/mywiki/BashFaq#faq1 -- How can I read a file line-by-line? <10> greycat, thx man <13> guys, can I do "cp *something ./dir" ? <4> !tias <14> Try It And See <13> tias? how does it works? <4> 21:52 <14> Try It And See <15> lo <13> the channel has a bot bash interpreter? <4> you know. !foobar mostly triggers something with bots. <15> how can I ungunzip and untar multiple files on same command ? im trying tar -zxvf sun*.tgz -C tmp but this says for each file, "file.tgz : not found in archive" <15> individually they extract fine <15> its just too many to go one by one <1> !faq untar <14> http://wooledge.org/mywiki/BashFaq#faq56 -- How can I untar or unzip multiple tarballs at once? <15> ok <1> I REALLY wish people would read /topic and look at the FAQ before asking the most obvious, banal questions over and over.... <15> yes <15> hey, greycat but its not banal to me :) <15> well, was not <15> thanks for help <16> how do I do this : if [ 0 == function_a() ] ; then exit fi , provided function_a returned an integer <8> which program is for extracting a part of a string using regular matches? <9> !math <14> http://wooledge.org/mywiki/ArithmeticExpression <9> PepperBob: there are a few. <9> grep, sed, even awk
Return to
#bash or Go to some related
logs:
is not a valid atom emaint world +how +to +extract +rar +bbl xorg .xession #oe #perl +replace +regexpression +manual #mysql #php jpgraph can't access PHP_SELF #perl
|
|