Home Page   #vim  #kubuntu  #slackware  #freebsd  #debian  #linux  #gentoo  #fedora  #ubuntu  #compiz-fusion  #bash  #suse  
Reliable $1 Web Hosting by 3iX

Channels


#bash

25 December 2007


Total 6 pages. You are browsing page 1/6.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last

--- Log opened Tue Dec 25 00:00:46 2007
00:10 <****> hi! is it correct - if err=$(command)...
00:10 <****> would IF operator test it for staus code?
00:12 <****> if there's assignment...
00:12 <****> iferr=$(command); if [[ $iferr ]]; then echo "ERROR"; fi
00:19 <****> whats the right way to call a function?
00:20 <****> crimeboy: shouldn't i if err=$(command)...? it works
00:21 <****> lng: dont
00:21 <****> http://www.pastebin.ca/831449
00:21 <****> this script is returning an unexpected end of file
00:22 <****> crimeboy: why not?
00:23 <****> crimeboy: you test on status code returned?
00:24 <****> syntax error
00:24 <****> you assume so i guess...
00:26 <****> <.<
00:26 * nolhay looks at all the lurkers
00:28 <****> hrmm i wonder what happens when you ctcp 313 people at once
00:33 * nolhay waits for action
00:36 <****> lmfao
00:38 <****> nolhay: you need a "fi" in function check_two?
00:39 <****> oh, sorry old version, i put the fi's in
00:52 <****> i lurk for ice cream
01:48 <****> mordaunt: rename yourself to "Crow" and I can help you
02:44 <****> how do you make script that does "lsof | grep cdrom" and takes the given PID:s and kills them
02:45 <****> the output is like:"PROCESS\tPID\tFOO\tBAR"
02:45 <****> Cr3ature: pkill cdrom
02:47 <****> not working
02:47 <****> (assuming cdrom is the process name)
02:47 <****> no its not
02:47 <****> hmm .. lsof ... somehow I read "ps"
02:47 <****> its the yea
02:49 <****> | awk '{print $2}' gets the pid
02:49 <****> you may want to, possibly, | sort | uniq the pids
02:50 <****> hmm yea
02:50 <****> and kill $( all of these in here)
02:52 <****> kill -9 ;)
02:52 <****> maybe -2 first
02:52 <****> -1 if that doesn't work
02:52 <****> and -9 last
02:53 <****> what do you guys think of this: http://pastebin.ca/831538
02:53 <****> but -9 works fosho ;)
02:53 <****> ok some process has seriosly gotten stuck
02:53 <****> -9 kills the program, but it doesn't do it in a pretty way
02:53 <****> CPU % is 100%
02:53 <****> all the time
02:54 <****> again this
02:54 <****> its the X org
02:54 <****> Cr3ature: What GPU do you run, and what version is it?
02:54 <****> Strykar_: too much hardcoded. at least 192.168.0.3 I'd put into a variable at the begin
02:54 <****> er, what version of X do you have
02:55 <****> Strykar_: path and filenames probably too
02:55 <****> var/log/authlog*
02:55 <****> i run geforce
02:55 <****> especially as you are using it twice
02:56 <****> When i run, source my.file
02:56 <****> how do i explicitly quit from it?
02:56 <****> when i call, exit, it closes my session
02:57 <****> Bushmills: i'll add those, it seems fine otherwise
03:02 <****> Bushmills: it's not actually, the elif statement will result in an email being sent irrespective of the file time :/
03:07 <****> Strykar_: "string appears twice", thrice even in case of ip adress. putting those in variables give you one place where to change it, in case you need to, rather than changing all instances of it.
03:07 <****> that's done and not the issue
03:22 <****> how do you quit from a script?
03:25 <****> on a bad day, by closing the editor, and turning off the monitor
03:26 <****> seriously, i call a script using, souce /myfile
03:27 <****> how do i explicitly quit from that script
03:28 <****> exit, exit 0, or let it reach the end
03:28 <****> for the latter, you'd avoid wild exits
03:28 <****> (from somewhere in the middle of the script)
03:28 <****> which is in general cleaner, but sometimes more work
03:30 <****> exit, quits the shell
03:30 <****> i just want it to quit the scrpt
03:30 <****> not the shell
03:30 <****> do you run it with . /path/to/script ?
03:31 <****> source <--
03:31 <****> not my choice, if it was up to me, i would have used, sh
03:31 <****> don't source it. run it in a new shell
03:31 <****> is there a goto in bash?
03:31 <****> i could just goto the end or something
03:31 <****> no
03:32 <****> what is "source" intended for?
03:33 <****> to run a script in the same shell, rather than a new shell.
03:33 <****> or could i just SIGINT or something?
03:33 <****> i.e. same environment
03:33 <****> can't you run it without sorcing it?
03:34 <****> sourcing
03:34 <****> the script is to setup a build environment, and there are a lot of conditions, loops etc..
03:35 <****> ahh, i think i found it in the man page
03:36 <****> cruiseoveride: oyu may trick it like this:
03:36 <****> you
03:36 <****> yes, i got it
03:36 <****> not sure whether that's the best q+d hack, but should work:
03:36 <****> you must use "return"
03:36 <****> start it with for foo in 0 ; do
03:36 <****> return works
03:36 <****> end it with done
03:36 <****> ah, ok
03:36 <****> could have used break with that
03:37 <****> while it runs once only
04:36 <****> !paste
04:36 <****> If you feel you MUST pastebin some code, make sure you actually asked a full, clear question in the channel first. Otherwise, nobody is going to look at your broken code. Then /msg greybot pastebins


Total 6 pages. You are browsing page 1/6.

First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last