#bash
28 December 2007
Total 10 pages. You are browsing page 1/10.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
--- Log opened Fri Dec 28 00:00:47 2007
--- Day changed Fri Dec 28 2007
00:00 <****> Linnk: find ... grep -q ... -print | strip trailing /* | uniq
00:00 <****> strip trailing /* left as an exercise.
00:01 <****> i was thinking -printf %h
00:01 <****> wow.. i have to select files which are 150. 300. 450. ... :\ i wanna cry.. how can i do?
00:01 <****> SiegeX6, yeah, I just found the %h modifier in man, thanks!
00:02 <****> seqizz: look at the for(( that was presented first.
00:02 <****> how can i use it in bash directly.. starting with : for... ?
00:02 <****> !seq
00:02 <****> seq(1) is a highly nonstandard external command used to count to 10 in silly Linux howtos. Use one of these instead: for x in {1..10} (bash3.x) or for ((x=1; x<=10; x++)) (bash 2.04+) or i=1; while [ $i -le 10 ]; do ...; let i++; done
00:04 <****> SiegeX6, hmm, apparently it's grep printing the results, not find, so the %h formatter doesn't work
00:05 <****> SiegeX6, it just prints double output in fact
00:05 <****> thanks i get it :)
00:05 <****> SiegeX6, so is there a way I can silence grep without silencing find?
00:06 <****> or... well, that wouldn't worke either
00:06 <****> ah, i missed the grep. in that case see twkm's little exercise
00:07 <****> hehe, ok :)
00:19 <****> I need to create a script which backs up directories, but skips files with a certain naming structure, say files which have 00000 in them, I need to use tar because it needs to go to a tape device, is this simple enough?
00:19 <****> Tabmow: yes
00:20 <****> but misleading input will give misleading output. say exatly what you want to exclude, not hypothetical examples
00:21 <****> There's nothing magical about the interaction between tar and a tape device.
00:21 <****> (That being said, tar is my usual choice of backup software.)
00:21 <****> siXy: Ok, I am fairly new to the scripting game, basically I have a VMWare server which I want to create a snapshot of running VM's, backup the VM folders (obviously excluding the in-use snapshot vm image) and back them up to tape
00:23 <****> I am not familiar with vmware. but presumably these snapshots are all you want?
00:24 <****> siXy: no, when the snapshot is created, a new file is made which contains the running image and changes are saved to that file, this allows you to backup the non-snapshot. So the snapshot images need to be skipped
00:25 <****> ok, then you just want a find using the prune option
00:25 <****> Tabmow
00:25 <****> Tabmow: http://wooledge.org/mywiki/UsingFind
00:25 <****> siXy: I was thinking of doing it in these steps
00:26 <****> List the directories and add all the files to an array
00:26 <****> Create the snapshot
00:26 <****> Backup the array of files
00:26 <****> Delete the snapshot
00:28 <****> Tabmow: seems sensible to me, although like i said i do not know how vmware works. you would do something like FILES=( $(find /path/to/files \( -name fileswedontwant -prune \) -o \( -type f -print \) ) )
00:29 <****> to get the files you want into array FILES
00:30 <****> to test it, after running that, do echo "${FILES[@]}" to show all the elements in the array
00:34 <****> siXy: will do, I'll give it a shot and see what I come up with... thanks
00:35 <****> np
00:43 <****> hello
01:09 <****> Ok I'm trying to create a fifo... what am I doing wrong?
01:09 <****>(tee -)
01:09 <****> bash: echo: write error: Bad file descriptor
01:20 <****> is there a way to connect to telnet and write command in the telnet with a bash script ?
01:20 <****> Thms: expect
01:20 <****> expect, perhaps... but that's a tcl program.
01:21 <****> Thms: is this really the telnet protocol, or do you just want to send/receive data to/from a particular port?
01:21 <****> I want to telnet my root, type the login, the pass, exec one thing, and bye bye
01:21 <****> Thms: Use ssh instead.
01:22 <****> telnet your root?
01:22 <****> Thms: Or get a telnet client that allows you to supply a username/password.
01:22 <****> I telnet my router
01:24 <****> \amethyst: What do you mean send data to/from a particular port?
01:26 <****> i included a script of code, is there a way to stop all the code from executing in the included script and just continue back to the main script?
01:27 <****> needles: What do mean by 'include'?
01:27 <****> needles: You mean 'source' or '.'?
01:29 <****> Which app sets the env var "LOGNAME=" ?
01:31 <****> Chapoolin: It's not part of my env. Maybe it's defined in your /etc files. Try doing 'grep -RI LOGNAME /etc'
01:32 <****> Lewoco:} ok, thanks
01:34 <****> why echo "$2" won't work ?
01:34 <****> no second argument?
01:35 <****> oh, sorry, it works :/
01:40 <****> hi
01:42 <****> I can't figure out how to use a variable as part of a variable name and I can't find anything on google. Any ideas here? I've tried eval var=\${myvar}_a_prefix
01:43 <****> pluffsy: http://tldp.org/LDP/abs/html/ivr.html
01:44 <****> _a_prefix is actually a suffix.
01:45 <****> pluffsy: also http://tldp.org/LDP/abs/html/bashver2.html#EX78 might be better
01:45 <****> nanothief: thanks a lot.
01:45 <****> twkm: true. I should probably go to bed :)
01:50 <****> is there a way to copy sparse array variables in a way that preserves indicies, other than looping?
02:15 <****> lucca: no.
02:35 <****> twkm: thanks
03:06 <****> What is the fastest way to see if a particular X server is running?
03:18 <****> gn
03:33 <****> hi folks
03:34 <****>$cat textfile|while read a;do if [ -x "${a}" ] ; then echo $a; fi; done ..
03:34 <****> i think the problem i have is that i used find to generate the text and the endofline is strange.. can someone help me?
03:38 <****> beetlepun: look at the faq for disappearing variables.
03:40 <****> twkm: isn't 'if' within while ?
03:43 <****> yes.
03:45 <****> beetlepun: best to paste the line you used to generate the textfile
03:47 <****>test.txt
03:49 <****> if that file is only used for the loop it is a waste of time. find ... | while read
03:49 <****> cat test.txt|while read a; do echo $a; sleep 1; done
03:49 <****> anyway, inside the while body a should have a value but unquoted will be word split so the echo may look weird.
03:49 <****> which works as expected... but am not sure what i'm doing wrong
03:52 <****> I don't have a problem with the 1st command you ran - though as twkm said the file is not needed
03:53 <****> well it would work without catting the textfile.. but that's what i'd like to do ;)
03:54 <****> It's a Useless Use of Cat.
03:54 <****> !uuoc
03:54 <****> Useless Use of Cat (cat foo | grep bar). See http://partmaps.org/era/unix/award.html
03:55 <****> I mean to say the command does not fail for me, not that I would do it that way :)
03:57 <****> everything cool-- was using the wrong test option ..
03:57 <****> thanks folks
03:57 <****> heh
03:57 <****> actually i'm comparing two branches......
04:00 <****> http://digg.com/2008_us_elections/Mike_Huckabee_If_you_vote_for_me_you_live_if_you_don_t
04:00 <****> Look at Mike Huckabee's psychotic comments.
04:00 <****> Vote Mitt Romney 2008. He is a tech savvy candidate that will put the US back on track economically and help us win in Iraq and defend our borders.
04:00 <****> Mitt Romney 2008
Total 10 pages. You are browsing page 1/10.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
