#bash
14 November 2007
Total 21 pages. You are browsing page 1/21.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
--- Log opened Wed Nov 14 00:00:53 2007
00:13 <****> how do i echo colors?
00:17 <****> Jyzygzel-
00:17 <****> Jyzygzel-: http://wooledge.org/mywiki/BashFAQ#faq37 -- How can I print text in various colors?
00:17 <****>&3 to see if i can write, but if i can't bash prints "Bad file descriptor" which i want to avoid
00:18 <****> hmm
00:18 <****> there's test -t to find out if it's a terminal, but that won't help you much
00:19 <****> /dev/null ?
00:21 <****> you really don't want to test something by poking it unless you really have to, though
00:21 <****>/dev/null before the redirect for 3
00:21 <****> though I guess that doesn't write anything, so it isn't all that bad
00:22 <****> well i have a bunch of scripts that expect to run in an a context where &3 is open to a logger process
00:22 <****> but i'd rather check first anyway ;)
00:22 <****> hmm
00:23 <****> hmm
00:24 <****> on a linux, see if /proc/self/fd/3 exists
00:24 <****>(cat)
00:24 <****> pipe:[23908]
00:25 <****> does it work in solaris?
00:25 <****> unlikely
00:26 <****> socat comes with a tool called filan that pretty extensively looks at its file descriptors, and is probably somewhat portable, but not many places have socat
01:34 <****> given hostname.domain.com
01:34 <****> ${NAME#*.} would be domain.com ?
01:35 <****> hi there
01:35 <****> hey sputnick
01:36 <****> Yes.
01:36 <****> hrm, i don't think cat file | uniq -u
01:37 <****> is goign to do what i expect, would it?
01:37 <****> wtf! http://pastealacon.com/163
01:37 <****> don't understand oO
01:39 <****> sh.t !
01:39 <****> GNU bash, version 2.05b.0(1)-release (i386-redhat-linux-gnu)
01:39 <****> is it too old ?
01:39 <****> That'll do it.
01:40 <****> sputnick: yes, redhat is always too old
01:40 <****> :)
01:40 <****> You're running RHEL3?
01:40 <****> for the work :)
01:40 <****> Red Hat Enterprise Linux ES release 3 (Taroon Update 3
01:40 <****> you're right
01:41 <****> f?ck !
01:41 <****> Only update 3? Ouch.
01:41 <****> old school !
01:42 <****> all upgrades is a big deal ;)
01:42 <****> *are
01:42 <****> Just use up2date, assuming you have a RHN subscription.
01:42 <****> But this is outside the scope of this channel.
01:42 <****> #rhel
01:42 <****> :)
01:45 <****> running up2date on this server causing loadaverage ( stack processus )
01:45 <****> I'm cursed
01:46 <****> RHEL 3 is a bit crufty.
01:46 <****> The later versions are *much* better.
01:46 <****> RHEL 5 even lets you use yum.
01:47 <****> I know, but it's NOT my own ivazquez
01:47 <****> :)
01:48 <****> hi, im trying to split output based on the : delimiter how can i do this?
01:48 <****> I thing I have to deal with sed instead of [[ foo =~ bar ]]
01:48 <****> :(
01:48 <****> ponyofdeath
01:48 <****> ponyofdeath: Parameter Expansion: Any expansion of a parameter (e.g. $foo, $1), but also complex operations like ${foo%.mp3}. See http://wooledge.org/mywiki/BashFAQ/073
01:49 <****> would it be at all appropriate to ask ssh questions here?
01:49 <****> since i am, after all, using them as part of my shell scripts.
01:49 <****> A bit. But they mostly belong in #openssh .
01:50 <****> it's a trui
01:50 <****> it's a true context
01:50 <****> ( or not )
01:50 <****> ponyofdeath: what do you mean by "split"? how will you use the results?
01:53 <****> #openssh is much more empty
01:55 <****> is it possible to do something like this ? : ${m#foo[1,2]} where 1 & 2 are the possible end of string
01:55 <****> Ok, I guess there are some bits of syntax and things where I would like a "BASH FAQ; SO you don't know how to program"... What am I doing wrong in this "if ($TRIES) == 5 && $OSTAT!=0; then $DIDNTWORK[$i]="2.$i.100 - $MESS"; fi"
01:56 <****> sputnick: where 1, comma or 2 are the end -- sure.
01:56 <****> Josh43: () makes a subshell.
01:57 <****> twkm: ${m1:2} ?
01:57 <****> sputnick: no. keep guessing, i'm sure you'll hit on something.
01:57 <****> twkm: I tried a bunch of different ways.. when I drop the (), I get "3==5: command not found" (if $tries = 3)
01:57 <****> though if you'd like not to guess ... ''man bash'', parameter expansion section.
02:01 <****> Josh43: what comes after if is just a command
02:01 <****> Josh43: but ($TRIES) == 5 && $OSTAT!=0 isn't a command
02:02 <****> \amethyst: Hm.. I think that's where I'm getting confused...
02:02 <****> like "if true" true simply being a command that returns true?
02:03 <****> right
02:03 <****> you want a command that evaluates arithmetic expressions
02:03 <****> in bash, that's what (( )) is for
02:03 <****> if (( $TRIES == 5 && $OSTAT != 0 ))
02:03 <****> does that hold true for [] as well?
02:04 <****> [ is a program, not syntax.
02:04 <****> I almost thought I had it there. rofl
02:04 <****> ((${LEVEL#exp} <= 1)) &&
02:04 <****> ok, so ignore [ ] in this case for now, and come to it later when I might need it, I think
02:05 <****> Josh43: yes, the syntax is different, and it has different features
02:05 <****> I think \amethyst has hit on my major stumbling block
02:06 <****> with [ ] you could do: if [ "$TRIES" -eq 5 -a "$OSTAT" -ne 0 ]
02:06 <****> is in if [ ls ./ |grep Desktop ]?
02:07 <****> no, that's not right
02:07 <****> that would be if ls | grep Desktop
02:07 <****> oh rightright
02:07 <****> !ls
02:07 <****> Please NEVER parse, pipe, grep, capture, read, or loop over the output of 'ls'. Unlike popular belief, 'ls' is NOT designed to enumerate files or parse their statistics. Using 'ls' for this is dangerous (word splitting) and there's always a better way (eg. globs).
02:07 <****> well, yes ;)
Total 21 pages. You are browsing page 1/21.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
