You are not logged in.
Pages: 1
To learn BASH scripting, I made an IRC client along the lines of sic in pure BASH. A hundred lines later, I've got something good enough to try at http://github.com/halhen/shic.
Features are similar to sic, plus support for configurable regexp based coloring.
As I stress in the README, I have only little experience of BASH scripting. Let me know where I screwed up.
Offline
What a masochistic project. I like it
[git] | [AURpkgs] | [arch-games]
Offline
Hm, might be worth checking out.
/me uses ii, it's awesome to sit and write scripts for it.
Offline
Thanks guys.
Daenyth: thanks for your tip on github. I changed my "$*" to "$@". I'm waiting for mr Mailman to bring Pro Bash Programming any day now, so I can straigthen out a few question marks like this one.
A few additions since the last post:
~/.shicrc and $XDG_CONFIG_HOME/shic/shicrc are read as config files automatically
The config variable SHIC_SCRIPT can contain ';'-separated input to be automatically executed at startup. For example, to join #archlinux and #python and set current channel to none at startup:
SHIC_SCRIPT=":j #archlinux; :j #python; :s;"
My shicrc, while similar to the default, is on github.
Now, I need to think about bloat. Already 90 lines of BASH code, and a whopping 129 lines with comments and blanks.
Offline
Interesting. Gonna check this out soon.
- [ My Blog ] | [ AUR Packages ] | [ My deviantART ] | [ screenFetch ] | [ SilverIRC ] -
Offline
Halhen -- great script, well done. Just the kind of thing that I like. I actually do use sic, but I prefer bash to c, so I've switched to yours. And it does colours!
Now a question for you: Would it be possible to connect to shic, disconnect from it and then reconnect again, using socat and unix sockets?
I was trying to figure this out the other day but couldn't get it to work. Something like:
socat SYSTEM:shic UNIX-LISTEN:shic-pipe
socat - UNIX-CONNECT:shic-pipe
But it dies when I disconnect. I think I need to get the first one to ignore the "end of file" sent when the second one disconnects.
I realise gnu screen can achieve a similar thing, but this is cooler and more fun.
Richard
Offline
TIL about socat. Very cool indeed!
Try adding fork as an option to UNIX-LISTEN as such:
socat SYSTEM:shic UNIX-LISTEN:shic-pipe,fork
. After this, it works for me.
Offline
TIL about socat. Very cool indeed!
Great isn't it? So now you could use shic as an interactive irc client, then disconnect and hand it over to a script to act as a bot (very easy with shic) and then reconnect for interactive use. socat ftw!
Try adding fork as an option to UNIX-LISTEN as such:
socat SYSTEM:shic UNIX-LISTEN:shic-pipe,fork
. After this, it works for me.
Perfect. Just what I was looking for--thanks for that.
Offline
So now you could use shic as an interactive irc client, then disconnect and hand it over to a script to act as a bot (very easy with shic) and then reconnect for interactive use.
Or... have it log to a file so you can see what was said when you come back.
Offline
Pages: 1