a few notes from the last time I got to code

now if only I had time to do things tonight… really what I need to get done, is move much of what’s left in main_loop() further into a subroutine, so I can implement source_bin() for the . / source built-ins and set it up to handle .tpsh_profile/.tpshrc files on startup through init_sh.

a few other serious things that need doing: hook our completion function into Term::ReadLine::Perl (I’m using Term::ReadLine::Zoid on my workstation; which is very easy to hook up to an app specific completion function); finish coding the completion hooks; implement `tpsh -c “cmds”`, in fact `(cmds)` could probably be expanded to that for sub-shell grouping, lol; write eval_bin(), the code needed for an eval built-in command is there, just needs the sub to bind it together; make `backquotes/backticks` needs to be handled by a pipe opened sub shell, rather then running the command directly with a pipe; and also support for an arbitrary number of pipes in commands, the place holder code in exec_pipe() only allows ‘lhs | rhs’; adding ${} expansion to variable expansion, $TMPDIR works but ${TMPDIR:-/tmp} and things don’t yet, but that’s trivial to code.

Really the only thing that worries me, is how to implement job control :. Setting up the built-in test command, [ which is gonna be interesting of course but actually doable, like control flow: fun but simple. The job control though, I’ve no freaking idea how to implement in pure Perl under unix/win32, yet…

# last stream of commits; html fixed

$ git log d59b9f864e916cd914be55b223702ec618c1ec4f..HEAD | sed 's/.../<snip>/g' | sed 's/.../sed@removed.it/g' | vim - 

commit 9450eca02b4dffcce6802b8fd72ba4e307ff7b9b
Author: Terry <snip> <sed@removed.it>
Date: Thu Mar 19 10:12:25 2009 +0000

exec and exit commands documented

Also CAVEATS & BUGS section updated about argumentless cd/chdir behaviour.

commit c24135e3748b9dbe8520b5794311af92e3affb36
Author: Terry <snip> <sed@removed.it>
Date: Thu Mar 19 10:06:20 2009 +0000

tpsh now exits with $? >> 8 if no exit status was given to the exit built-in

commit a9138f5991142960114f6898e7d57185eff00256
Author: Terry <snip> <sed@removed.it>
Date: Thu Mar 19 09:59:59 2009 +0000

cd and chdir commands documented

commit 3145e1a5672330fc913e93b3992b7c6591ff58a8
Author: Terry <snip> <sed@removed.it>
Date: Thu Mar 19 09:53:58 2009 +0000

CDPATH handling skipped if path starts with / or .

commit e6f8690d05308789a31fb906a28b1dbeba304ec4
Author: Terry <snip> <sed@removed.it>
Date: Thu Mar 19 09:20:22 2009 +0000

builtin command documented

commit b789721176eeb7d157d7c42e38044b1c111fa3dc
Author: Terry <snip> <sed@removed.it>
Date: Thu Mar 19 09:16:44 2009 +0000

bugfix: alias expansion turned off for builtin command

noticed that after `alias echo foo`, that `builtin echo …` would
expand to ‘builtin foo …’

commit a6a7eeddb5309af903569aee31bb5f15ceef9d6e
Author: Terry <snip> <sed@removed.it>
Date: Thu Mar 19 08:46:20 2009 +0000

alias name now displays ‘name’ => ‘definition’

Also alias expansion is now disabled on the alias command as well as
unalias. This prevents expanding the lhs (name) of an alias when name is
given, but definition is not (e.g. `alias name`)

commit 99a57b1b88d58f4ad6b318c181668cf5f5e9eeda
Author: Terry <snip> <sed@removed.it>
Date: Thu Mar 19 08:21:19 2009 +0000

bugfix: rhs of alias definition is no longer sh_eval()’d by alias_bin

alias_bin has ran sh_eval() before storing the macro since commit
2da5a0e38e3d14c29b0fb93ad89797826a41ddac, which was causing expansion of
things like `alias lah=’ls -a $HOME’ to be stored as ‘lah’ => ‘ls -a
/home/Terry’ instead of ‘ls -a $HOME’; as the quotes were pre-expanded
on the command line, alias would receive and expand the environment
variable itself.

commit a9177482c3398a6272382672e45ea9d5e8254960
Author: Terry <snip> <sed@removed.it>
Date: Thu Mar 19 08:11:23 2009 +0000

alias built-in documented

commit 8296bb37be75e1e7c301c1ed316db13aa6c9c26d
Author: Terry <snip> <sed@removed.it>
Date: Thu Mar 19 07:34:16 2009 +0000

bugfix: SIGPIPE now handled by exec_pipe()

Previously a construct like `ls | head 1` would cause tpsh to terminate,
due to receiving an unhandled SIGPIPE on unix. tpsh now traps the signal
and will report an error if desired.

Display of the error message can be turned with the ‘reportpipe’ option,
which defaults to off.

commit b44b8f3b4cf6adedf972bf719f4de1546fc8a8b1
Author: Terry <snip> <sed@removed.it>
Date: Tue Mar 17 23:44:38 2009 +0000

noclobber mode is now implemented

commit 842d3a308e2663c15dc75600c19eb7f096664341
Author: Terry <snip> <sed@removed.it>
Date: Tue Mar 17 23:21:58 2009 +0000

+flag is allowed, i.e. +a

commit 289837932bf4af21c41c538e32e2d886d6f9a03b
Author: Terry <snip> <sed@removed.it>
Date: Tue Mar 17 09:26:30 2009 +0000

added set built in command and command line arguments to the manual

commit e1badaaf1e873ae0808eecb79b1b3a07219752f5
Author: Terry <snip> <sed@removed.it>
Date: Tue Mar 17 08:18:07 2009 +0000

the verbose option now works

xtrace now also prints to stderr, IAW with ash

How many people tell me to go to sleep…

By country so far… (lmao)

  • USA (to many to count)
  • Great Britain (2-3)
  • Canada (2-3)
  • Germany (2-4)
  • Denmark (1-2)
  • Norway (Just 1, luckily lol)
  • Russia (1)
  • India (1)
  • and possibly (1) in Italy :

The wonders of the Internet…. lol; what next, people from France and Australia?

Cheap exercise

Between carting crap uo/down stairs, carting crap to and from the car (another set of stairs), and extra crap to do (a third staircase); I’ve just survived 38 trips up and down stairs, in about 6-12 trip bursts during ~3 hours time lol.

To top it off, when I took Willow for a walk she just had to go for a run instead… Ever seen a grown man dragged by a Chihuahua? LOL.

I really need to give tpsh the ability to use $HISTFILE to save/restore the ReadLine history between sessions…

Grr!!! Even when I can finally sleep, I can’t sleep. Fell asleep earlier after dinner, got woken up and then staggered off to bed; now I’m awake again and more tired.

And the dogs got all the covers! *sigh*, there is just no winning in this place lol.

And *now* I can pass out…. lol

I was like a zombie at work yesterday, by the time I got home it was a splitting headache and felt like someone had kicked my bodies equilibrium on its side. Like working until burned out, then re-burn the burn out and keep marching :. Crashed in front of the TV and went to bed early… work wasn’t so bad today. What pissed me off is being re-tasked to reconnoiter a new grocery store on the way home -> I freaking hate shopping! I also don’t appreciate being made late…

I just got though with a training session, kind of organized chaos I guess but that’s thanks to my shitty work schedule. I conducted a deeper level of stealth training then we usually go into, and I used Ghost Recon to do it; JB, Noer, (at end) Ghost, Ambu, Carter, Decapi, Hostile, and Chester. I tried to iron it out how issues of rules of engagement, positioning, observation, reporting, and coordination of movement/fire command could be used to make the most of covert actions. After we did the training scenarios (ambushes, infil, etc), we moved on to a “shoot your instructor” scenario; where they had to sneak up behind me with MP5SD’s and go for the CQ kill. The trick was, I was on patrol with an AK and weapons free to shoot at anyone I saw trying to sneak up the hill hehe. I was a little disappointed with how long it took (I scored 2 kills, but 1 was probably a glitch) but overall very impressed with their effort (especially JBs). It was very, very pleasing to see them complete that scenario so well.

What can I say, I borrowed that one from U.S. sniper training and simplified it for our gaming environment lol.

With how long it took between setup and intermissions (note to self: be more strict), we didn’t get time for the RvS or S4 portions, considering the big attendance maybe that can do for session 2 next week; whatever. Really I should have just laid down for a nap after work but it was a good 3 or 4 days prep into the session, and one of them days where almost everyone’s there at just the right time.

Right now, I ain’t moving until the foods on the table – unless I’m snoring on my feet in the process!!!

notes to self:

commit and push changes to ~/.screenrc
continue evaluation of weechat
finish tweaks to .fvwm/config
commit and push changes to ~/init.sh

good news: I get to conduct some training sessions soon
bad news: I go back to work Tuesday 🙁