| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9
Comments:
<0> how do i use *.diff file to make changes on other file? <1> use the help of "patch" <0> heiner, thx, but how do i know what is original file if patch file is named style.diff, and i need it for TinyXml source files? <2> [cro]smiley: man patch, read -p option and just the description <3> how can i pull lbl-internal.20050107-1424.port027.dump.anon out of this line: <img src="/icons/unknown.gif" alt="[ ]"> <a href="lbl-internal.20050107-1424.port027.dump.anon">lbl-internal.2005010..></a> 14-Oct-2005 15 29 770 <0> snappy, thx i was looking patch --help. I'm glad you made me read :) <4> bash newbie, why doesn't this code work: <4> while [ ! -f "$archive_directory/$file.$i.gz" -o ! -f "$archive_directory/$file.$i" ]; do <4> ((i++)) <4> done <4> i'm trying to go through a log archive to find the lowest unused log number <5> gnychis: depends how persnickety you want to be about it, but I would probably grep -o 'href="[^"]*"' | sed 's/^href="//; s/"$//' <3> Vasistha: thanks <4> that code just produces an infinite loop. can $i be used again in the while expression? <5> phatmonkey: I'm trying to figure out what it is you're trying to do... <4> i have a directory of log archives number log.0.gz, log.1.gz, and so on
<4> i'm trying to find the lowest available number for the next log archive <5> phatmonkey: have you considered doing something more like ls log* -v | tail -n 1 <5> phatmonkey: alternately, log* -t would sort by time, which also ought to work <4> ah, smart <4> but then if there was a log.0.gz and logfoo.0.gz, surely log* <4> wait, nm, i'll just do log.* <4> then how can I add 1 to the integer in the filename? <5> well, it depends how well-defined your log file names are ... perhaps you want log.*.gz <5> last_log_num=$(basename ${filename#log.} .gz) <6> hello <7> how to check if a file exists regardless of case? if [[ if /file\.txt/i ]]? <7> s/[[ if/[[ -f/ <8> shopt -s nocasematch && shopt -s nocaseglob <9> Is there a way to make a <() file to have a specific file extension? <8> Kuwanger: Write all in an array arr=(<(whatever).extension); echo "${arr[@]}" <9> WoodyWoodpecker: Uh, how will that help exactly? <8> You got your extension. <9> Uh, the file doesn't exist. <8> You know <() is process redirection. You save the output of this process in an array 'arr' and hang its extension on there. <10> o_O <4> Vasistha, last_log_num=$(basename ${filename#log.} .gz) - what is that doing, I don't understand <10> Kuwanger: i doubt you can make it have an extension, it's 'just' a filedescriptor, those are numeric (iirc) <9> Knirch: Right. I just sort of hoped that bash offered a way to make a symlink to it or something. Thanks anyways. <10> use a named pipe <9> Knirch: Hmm..that's a good idea. <8> phatmonkey: Strip shortest match of 'log.' from beginning of 'filename' and get the basename(1) of it, after that add .gz to the result. Then ***ign everything to last_log_num. <5> phatmonkey: well, it takes two steps to get what you want... <5> phatmonkey: strip off the "log." from the beginning, and strip off the ".gz" from the end <4> hmm, i don't seem to have basename in my paht <4> path <5> phatmonkey: then let's do it a different way, anyway, let's just drop basename entirely <4> ah, i've found a way that works <4> while [ "1" ] with an if and a break <4> not very neat, but it's working <5> phatmonkey: whatever works for you. using ls | tail will be much faster (especially with a long list), but if performance is not an issue, then whatever's easiest to maintain is best <4> hmm, you're right actually, performance is a bit of an issue <4> oh well, the lists aren't going to be big, this'll be fine, thanks for the help <5> phatmonkey: anyway, if you want to do it the other way: man bash and see the section on parameter expansion. You'll want to do, e.g., last_log_name=$(ls -t | head -n 1); temp=${last_log_name#log.}; last_log_num=${temp%.gz}; <11> from a script----- mv $1 $2.txt . Now should "script-name sometextfile.txt renamed" work? <11> this gives an error----- mv: target `renamed.txt' is not a directory .. <12> grizzly: That error messages means that mv received 3 or more arguments, and not just the 2 names you intended. <12> grizzly: With 3 arguments, mv expects that the last name is a directory, e.g. mv file1 file2 dir1, to move file1 and file2 into dir1. <12> grizzly: Put a 'set -x' at the top of the script, and run it again to see what is really going on. <13> How do I run a command stored in a variable? <13> what? no response? <13> How do I run a command stored in a variable? <14> echo $($var) <13> Thought that was a hack. <13> rodrickbrown: doesnt work <15> you can use eval <16> foo="ls -l"; $foo <17> kbrooks: it does here. but if you want the output as formated by the command, you should use echo "$($var)" <15> it's dangerous though. <13> i dont :-) <17> actually simply $var as shown by grepper works too. <18> windoz is so use[r]less <18> and they call bull**** tech <18> its smth to trash <18> wtf <18> linux is halfways <18> still
<18> too away <18> computers - COMP <18> are about - to bring - tech near tot he user <18> dead over the user <18> since they dont live, dont speak <18> all static hertz bull**** <18> all battery tech is bull**** anyway <18> ill do a teraherz comp, i hope, soon <18> somebody <18> brought the idea of computers, electronic, crap, back to this eartch <18> no fool would ever come to the stupid idea to make static bull**** with hertz <18> like lamps <7> SPAM <18> we'd be able to see int he dark and stuff <18> stfu <18> alcohol like tea <19> xmb: is there a bash-shell related point to your rant? <16> xmb!*@* added to ignore list. <18> stfu <18> around 350 scripts @ hotline://codebong.com <18> or http://xmb.ath.cx/code <18> spam is added to ignore list foo <18> ignore <18> like you have anything else4 to do <19> you obviously don't <18> dude dont **** <18> this is irc <18> or you like hertz <18> listening to the hertz of your comp <18> too bad they're statical <18> all you hear is your env <18> foo <7> can someone get this joke out of the channel please? <19> I would if I could <18> dude im the master here, SSTFU <19> you misspelt lamer <18> you dont remember me fool <18> if i could <18> 'oh yes if i could' <18> i would change the world <18> and **** ****s <18> stfu <7> revdiablo: r00t|vaio: please! <18> LOL <18> srfu <18> getr your joke of stfu out of here <18> the silence <18> you'r on irc, this is communication <18> stfu <19> I prefer silence to pointless rambling <18> noob <18> prefer macs, not windoz, noob <18> mac read an error box in <1 sec, no matter how long it is <18> windoz and linux, in this resp., is crpa <18> joker <18> damnit how can i forget my icq p*** <18> bored users <20> hey guys, I'm trying to bind a key combo to a script I wrote, but it's not working. I have a zenity dialogue running from it, and it's just not running when I hit the bound keys. <21> so first debug your window manager, make sure it tries to launch the script. <21> or put something into your script that shows that it was run, even if you "see" nothing. <20> twkm: I'm actually not sure how to do that. <21> then work outwards from there. <20> oh wait, I just found out that Control + Shift + P works, but Mod4 (super) + P doesn't <20> that's weird... Mod4 works in other bindings <20> I wonder why mod4 won't work for this one binding? wtf...+ <22> y0 <23> I need to write a regular expression for grep that would print everything but commented lines. This includes lines that have zero or more spaces/tabs and then a '#', a '!' or a ';'. I am failing, so can you please help me? <23> `egrep -vh '^[#!;].*|^[ \t]*[#!;].*' "$@"' --> Not good for lines that have spaces or tabs. <24> grep -v '^[[:space:]]*[^#!;]' -> untested <24> egrep <23> m4n: Thanks, but something's wrong with it. <24> redondos: tell me <24> redondos: do you have a sample file ? am lazy to make one :-) <23> Yes.
Return to
#bash or Go to some related
logs:
#ai selinux fstab swapon fedora +rt2570 +dhcp +suse +wpa2 thelostfaith,net
vmware PXE-M0F compile paragon ntfs gentoo gdm fallenangel fedora ibm x206m #ai lone zero block ebuild
|
|