| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11
Comments:
<0> but this not: sed -n "#^$folder_to_backup#p" <1> i got tr to turn something like "reeeeeally" into "really" but it needs to be consecutive <0> nonsense <0> this works: sed -n "/$ftb_s/p" <0> but this not: sed -n "#^$folder_to_backup#p" <2> give: for any other then the s-command use \XfooX <0> \XfooX ? <0> sed -n "\#^$folder_to_backup#p" ? <3> is there smth like ${var/blah} ? <2> give: for the normal addressing match i mean. the s-command is something else. it can handle it directly <2> give: in your case: \#foo# <4> Peper: parameter expansion. <2> give: (and remember that bash eats up one \ inside doublequotes) <2> "\\#foo#" <0> TheBonsai: Wonderful! <3> trash: can't find this one in any manual
<3> what it does? <4> Peper: man bash <2> give: but again, i'd prefer the parameter expansion syntax mentioned above... saner, quicker, easier <2> Peper: you CAN <2> Peper: man bash, press "/", enter "parameter expansion", press <enter> <2> trash: *rumlad* <3> TheBonsai: i mean i can't find ${var/blah} in there <4> lad? nicht lag? ;) <2> Peper: i doubt, lemme have a look <3> there is ${var/blah/blah2} <2> ${parameter/pattern/string} <2> ${parameter//pattern/string} <2> The pattern is expanded to produce <2> <etc...> <0> TheBonsai: inside the (cd ...; tar ...) > yeah.tar shall i still use the --create option of tar? it works, but im not sure. <2> Peper: READ <2> If string is null, matches of pattern are deleted and the / following <2> pattern may be omitted. <2> Peper: you found it in manual, but you didn't read it. makes no sense. <3> Peper-- <3> ;] <2> give: as in "c"? yes. <2> tar c . <2> trash: knapp 15K <0> TheBonsai: ok <2> trash: feddisch... <4> muhaha <2> poor guy :) <4> ack! <4> that's really bad luck. <0> How can I tell a script to stop executing if ANY error occurs? <4> give: set -e <0> thats all? wonderful <0> did not work <4> sure does. <0> when tar errors, the next command is still issued <4> $ (set -e; tar --hsdfsdf; echo foobar) <4> tar: unrecognized option `--hsdfsdf' <4> Try `tar --help' or `tar --usage' for more information. <4> trash@waste ~ $ <5> how to change uppercase to lowercase via sed? <6> how do I echo escape characters like \n in /bin/sh? in bash I can do echo $'\n' but it doesn't work in sh... <2> give: man bash, check out the "trap" command <7> i3dmaster: why via sed? <2> IYY: bash called as sh doesn't disable that feature <2> IYY: at least here <7> i3dmaster: just use tr <5> Knirch, well need a stream editor not interactive for scripting <7> tr A-Z a-z <5> tr takes variables? <5> ok, will try <6> TheBonsai: I meant sh itself, not bash. I happen to be running on a very unusual system that doesn't have bash. <2> bonsai@mainserver:~/tests$ /bin/sh -c 'echo $'\''\n'\'' | cat -A' <2> $ <2> IYY: what is your "sh" <5> Knirch: works. thanks! <2> IYY: a korn? ash? zsh? bash? <8> "while read i" <- how can I make this read until eof? <6> TheBonsai: I think it's just 'sh' <2> alice|wl: while read foo; do ..; done will read until eof
<2> IYY: which system? <6> TheBonsai: ARM Linux <2> IYY: and it's not bash? weird. sure? <6> root@snapper:~# echo $SHELL <6> /bin/sh <2> ls -l $SHELL <2> and if it's a normal file, ls -li /bin/sh /bin/bash <6> ah, it uses busybox <2> there we go <2> makes sense somehow, busybox is usually static and /bin/sh is good to recover <9> How would I count the number of a certain letter in a variable? <6> TheBonsai: I suppose... but how would I use an escape character with this <2> IYY: command substitution and printf <2> IYY: or some other method (most likely something that ends up in command substitution) <6> TheBonsai: awesome, that works :D <6> I didn't even know about this command. works like in C, yes? <2> IYY: which is bad for \n, as trailing newlines are stripped off by ``/$() <2> IYY: it works nearly 99% like the C one, yea. printf "formatstring" <values..> <2> printf is meant to superseed echo <10> yeah? but its as fast as echo? <2> to print simple strings? i'm sure. <2> and the rest can't be really compared since echo lacks most of printf's functionality <2> and echo has its weaknesses <8> I want to build a chat tool for ppl on the same computer. thaught it might be pretty simple with some fifos <2> man talk <2> why reinvent the wheel <2> unix is old, most things are already invented <11> wth <11> this isnt making a directory <11> if [ ! -d "logs/$service" ]; then mkdir $service; fi <2> that makes no sense <2> if you're in logs/ the check fails, if you're above logs/, the mkdir makes no sense <8> talk might be complicated to implement into other tools like a web-page or gdesklets. but I ll have a look <2> alice|wl: talk is a protocol <2> alice|wl: (also a protocol) <11> ah thanks man <2> alice|wl: and there are commandline clients and also X clients i saw <11> some days! <2> _sho_: overworked? <11> yeah <11> just a tiny bit <12> an excercise for shell hackers of good will: run a command, and redirect so that you get: 1) an ERR file with only stderr 2) a LOG file with both stdout and stderr 3) both stdout and stderr on console <2> omg, sounds like .... mh, you can't simply diplicate data by redirection <12> you can use tee(1) <2> tee(1) must be involved <2> also that fscking sounds like homework <2> ;) <12> no, it's not homework, I was thinking about using it myself when building, and I tought it was a funny thing to do <12> I'm used to redirect ERR only to a file, but that's w/out context <12> so having both ERR and OUT is good, but I also want ERR only for quickly checking if there is or not any problem <12> if it turns out to be a simple enough command I'd start using it:) <12> oh, there are possible changes in requirement too, for example having only ERR on console <12> basically, the hard part seems using two tees (one for stderr and one for stdout) <2> bonsai@mainserver:~/tests$ { { echo stdout; echo stderr >&2; } 2> >(tee ERR | cat); } | tee LOG <2> stdout <2> stderr <2> bonsai@mainserver:~/tests$ cat ERR <2> stderr <2> bonsai@mainserver:~/tests$ cat LOG <2> stdout <2> stderr <2> bonsai@mainserver:~/tests$ <2> next one please <2> ;) <12> lol <12> you're good eh ? <12> but I don't like it... it's using bash-only syntax <2> not that good, but i found it was a nice issue to test my skills <12> get rid of >( and you can go to next item :) <2> yea, bash specific <2> the prob is to strip out the stderr to ERR <12> you should tee stderr only <11> tee it all baby! <11> all of it
Return to
#bash or Go to some related
logs:
debian umount invalid argument pts shm #math #ubuntu debian Marvell 88E1111 PHY #debian slackware linux-libc-headers tobaz rock ARM opcode table #mysql #gentoo
|
|