| |
| |
| |
|
Page: 1 2 3 4 5 6 7
Comments:
<0> twkm, could you please just explain how curly brackets functin , or point out what doc to read <1> time uses the parent shell's stderr, { } is an odd way of gaining access to those fd's. <0> oh i see <2> does this look better, for locking? report_and_fail is a function that emails a report and exits. http://pastebin.com/740605 <3> hi everybody <2> hi <3> i have a function called runcommand <3> i now wanna write a wrapper function, which duplicates the output of runcommand and writes it to a logfile <3> i did <3> function runcomlogged () <3> { <3> rm $1.log <3> runcom "$1" "$2" | tee $1.log <3> } <3> but it's not writing to the logfile. <3> whats my fault?
<4> lol <2> seems like a weird way of doing it, what exactly do you want to log <1> martoss: set -x is your friend. <1> pastebin.com still isn't responding for me. <2> should i paste somewhere else? its also slow for me <5> http://rafb.net/paste is good too <2> ok, going there <2> http://rafb.net/paste/results/L7Dxrl25.html <1> fbtab: don't remove the lock until the things that must not be done more than once at a time are complete. <2> if it gets a signal, it will be exiting, so should it not remove the lock before that, incase of leaving dead/stale locks behind <2> :w <2> oops, sorry <3> i dont't understand what set -x has to do with that. <1> it should help you to find what went wrong. <3> set -x seems to be for debugging purposes <3> ok <2> twkm: the removing of the lockfile is being set in the trap, so im thinking it should delete the lockfile before exiting.. <2> what do you think <1> what if you exit successfully, no signals? <2> im not trapping 0, but manually 'rm -f' the files at the end of the script <1> ahh. <4> faq updated. <6> hi <4> that long wiki page is stupid... we need some solution that can break it down into single question entries <4> at least for editing <2> GDG: hi <1> most wiki's allow multiple pages. doesn't greycat's? <6> I'm defining the PS1 variable in this way: PS1='[\e[33m\t\e[0m] \u@\H:\e[31m\w\e[0m \$ '... when it print path before the prompt it can take many column due to deep nesting in the filesystem... can I set a max length for the printed path adding something like [...] before ? for example [...]/deep/long/path/ <4> and this wiki markup junk makes me sick <4> GDG: use a script to create the prompt and stick it in PROMPT_COMMAND <7> i think he wants something like mediawiki, where each header etc creates an editable section, whereas the wiki of choice for the bash faq only permits editing the whole page <4> that way you can do whatever <4> Fatal: i want a faq-o-matic that uses html bodies :P <1> !faq prompt <8> http://wooledge.org/mywiki/BashFaq#faq53 -- I have a fancy prompt with colors, and now bash doesn't seem to know how wide my terminal is. Lines wrap around incorrectly. <9> twkm: 53. I have a fancy prompt with colors, and now bash doesn't seem to know how wide my terminal is. Lines wrap around incorrectly. <9> twkm: http://shelldorado.dyndns.org/wiki/index.php/BashFaq#faq53 <1> greycat: doesn't your wiki allow multiple pages? <1> r00t|vaio: yeah, except that they all seem to get raped for xss flaws every other day. <10> if you mean editing parts of pages, no, unfortunately. <11> twkm: make them read the faq entry on eval <1> i mean, multiple pages, so that the "main" faq page would be shorter, perhaps with just the q's. <7> imho it's good to have a _big_ faq, i fetch solutions from the faq every now and then, but rather i search for part of the solution, i almost never come up with the same question as it's stated in the faq <10> sure, it could be split into multiple pages. but someone would actually have to do it. <1> heh. <11> greycat: why "someone"? <1> yup, ##c's wiki suffers from organizational apathy -- mine, mostly -- too. <11> i'd say... "someone's computer" <10> r00t: because FAQs are notoriously unwilling to change themselves spontaneously <1> speaking of ##c's wiki, i guess i need to get that second host going. <12> Hello all :) <12> I have a quick bash scripting question: <12> Say I have a string: ZENO="c:\foo\bar" <7> and i'd rather load the site with one request and a bigger chunk of data, rather than clicking around visiting maybe 5-6 pages before actually finding what i was searching for.. but that's maybe just me <1> meZeno: ewww! <12> No I want to replace the \ by / (backward to forward slash) <12> ghaha ;) <1> meZeno: parameter expansion. <11> Fatal: the concept of optionally having both formats is just too hard for wikitards to understand <10> string=${string//\\/\/} I think <10> or something else equally ugly
<12> I tried this : echot ${ZENO///\//} <1> i looked around a little for useful wiki's or faq engines for ##c -- nothing really smelled any good. <10> meZeno: how did you come up with *that*? <1> too many initial /'s <12> well {ZENO//X/A} -> X replaced by A <12> well {ZENO//X//} -> X replaced by / <12> well {ZENO//\//} -> \ replaced by / (doesn't work ofcourse) <12> so i tought: <12> well {ZENO///\//} -> \ replaced by / (escaping it) ;) <1> you need to escape with \ <10> / is not an escape-character. \ is. <1> ${var//\\//} <10> 08:19 greycat> string=${string//\\/\/} I think <12> ${ZENO//\\/\/} doesnt work .. <12> it doesn't give errors, but I get the original string back <10> try twkm's, then. he's usually smarter than I am. <1> quoted the //\\/\/ does odd things. //\\// works quoted or unquoted. <12> hmm.. doesn't seem to work :( <10> imadev:~$ echo "$string" <10> c:\foo\bar <10> imadev:~$ echo ${string//\\/\/} <10> c:/foo/bar <10> imadev:~$ echo "${string//\\/\/}" <10> c:\/foo\/bar <12> bash-2.02$ echo ${zeno//\\//} <12> C:\da\la\blaaaa <12> bash-2.02$ <10> what's the original string? <1> zeno vs ZENO? <1> $ foo="c:\foo\bar" ; echo "${foo//\\//}" ${foo//\\//} <1> c:/foo/bar c:/foo/bar <10> also note he's running a horribly old version of bash <10> nobody should be running anything other than 2.05b or 3.x without a good reason <12> bash-2.02$ echo $zeno <12> C:\da\la\blaaaa <12> I have a good reason :) <13> meZeno, just use sed, will ya :p <10> imadev:~$ zeno='C:\da\la\blaaaa'; echo ${zeno//\\//} <10> C:/da/la/blaaaa <10> try it on a newer version of bash. if it works for you on the newer version, then it's time to upgrade. <12> sed, isn't that like, only for files? <13> not really <12> I can't upgrade :D <10> no, it's, like, for streams. that's why it's, y'know, a stream editor. <10> meZeno: why not? <1> yeah, prehistoric bashen aren't worth worrying about, but for meZeno being stuck there points at sed. <12> If I tell you why.. you *will* kill me :D <12> I am running bash from windows :) <12> :$ <12> Why> <12> well, <10> oh. that's not a ban-hammering or ignoring offense. <10> but you can upgrade. you're just unwilling. <12> have some scripts from linux, which I am running on a windows machine for a short wile .. <10> I'm quite certain cygwin's version of bash is later than 2.02. <12> and, I couldn't really find any bash newer then this one, without breaking stuff.. <10> you "found" it? gah... there's your first problem. <12> =) <12> ghaha <12> Cygnus :D <10> where did you "find" it? a moldy trash heap? <12> Byt, ehm.. any ideas on how to do this thing with sed? <13> $] var="\\" ; echo "$var" | sed 's,\\,/,g' <13> / <12> I found it @ the junkjard ;) <1> yes, same way, more or less. <10> you either install cygwin, or you build bash yourself using whatever toolkit is required for your environment. <10> you don't just use a random binary that you found lying around in the seediest corner of the internet <13> that's a good advice :P <11> btw: it's a great feature how in any non-css browser the edit box on the wiki comes up about 16 characters wide... <11> (just that it's too long to edit in a browser anyway, so i just use one that can spawn an external editor for textboxes <10> that's why I use mozilla/firefox with the mozex extension
Return to
#bash or Go to some related
logs:
ubuntu jstest mplayer devfb flicker hp scanjet 4670 ubuntu #debian #osdev +Kmix +OSD +disable +suse #php backuppc Xlib: connection to
(ext2ifs OR ext2dfs) smbfs #web
|
|