15 January 2014

Notes on using the shell

Since I mostly use the shell under embedded linux, when I say /bin/sh I really mean /bin/ash, the Almquist shell, which is compiled into BusyBox and therefore pretty cheap resource-wise.

Maybe there are some people out there who like shell syntax. Suffice it to say I am not one of them. 


Some helpful links for myself:
The secret to successful shell Googling is knowing that "[" is pronounced "test".

Code Chunks

I can't believe I have to actually write down how to make a for loop.

POSIX-compatible For Loop

while [ $i -lt $max ]; do
  echo "$i"
  true $(( i++ ))

Assuming I can edit blogger posts, I'll edit this later.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.