Categories
Lab Software

Compiling bash-3.0 on Interix

So you’ve followed my instructions for updating config.guess for Interix 5.2 (the version shipping with Windows 2003 Server R2) and now you want to compile something. Interix ships with C Shell (csh) and Korn Shell (ksh) but lacks the Bourne Again Shell (bash) – the shell most Linux users will be familiar with, so why not start there? From Start->Programs->Subsystem for UNIX-based Applications start either ‘Korn Shell’ or ‘C Shell’. You’ll end up in ‘/dev/fs/C/Documents and Settings/’ (this is your home directory, ‘~’) and the root is ‘%SystemRoot%\SUA’. Download bash-3.0 and extract it somewhere sensible (like /usr/src). You’ll need to ‘gunzip bash-3.0.tar.gz’ first and then do ‘tar xf bash-3.0.tar’ as it’s not gtar so it doesn’t understand ‘z’ (gzip) and ‘j’ (bzip2) options. Change to the ‘bash-3.0’ directory and ‘./configure –prefix=/usr/local/bash-3.0’, then ‘make’ and ‘make install’. Now it’s just a case of creating a link to ‘%SystemRoot%\posix.exe /u /c /usr/local/bash-3.0/bin/bash -l’ in the start menu. When you click on this link you’ll end up with a window that looks and behaves like a command window, only with a red/yellow/blue logo.

You may get errors like ‘error retrieving current directory: getcwd: cannot access parent directories: Undefined error: 0’ – I suspect these are due to permissions problems, or issues with spaces in paths. I’d be interested if someone has a better explanation, especially if it came with a fix.

By Sam Johnston

Sam Johnston CMgr FIML GAICD MACS Snr CP is an Australian technology executive and serial entrepreneur with over 20 years experience founding and advising startups, and in leadership roles at top global technology companies including Citrix, Google, and Equinix.

Sam is currently the director of labs at DXC Technology, whose mission is to ensure the company is fully equipped with the emerging digital technologies it needs to lead clients through accelerating change, including drones, robotics & humanoids, 3D printing, computer vision & voice, augmented & virtual reality, artificial intelligence & machine learning, blockchain, chatbots, and quantum computing.

Sam has a bachelor of computer science degree from the University of New South Wales, and is based in Singapore, having worked in Australia, Asia, Europe, and the USA.