LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old
Rating: 2 votes, 5.00 average.

Bash scripts and keyboard input

Posted 01-29-2012 at 02:43 PM by Nominal Animal

You can use Bash to read individual keypresses. Here is an example:
Code:
#!/bin/bash

# Reset terminal to current state when we exit.
trap "stty $(stty -g)" EXIT

# Disable echo and special characters, set input timeout to 0.2 seconds.
stty -echo -icanon time 2 || exit $?

# String containing all keypresses.
KEYS=""

# Set field separator to BEL (should not occur in keypresses)
IFS=$'\a'
...
Senior Member
Posted in Uncategorized
Views 9429 Comments 0 Nominal Animal is offline
Old

Computer Mad Science: The Anatomy Of A Makefile Part 2

Posted 01-28-2012 at 01:24 PM by rainbowsally
Updated 04-09-2012 at 05:44 AM by rainbowsally (updated makefile creator posted)

Note: There's a much more full featured and easily customized makefile creator here. Many features can be added without even recompiling it.
http://www.linuxquestions.org/questi...eration-34648/

For historical reasons we'll keep this blog entry for a while, I guess. -rs

------------------

Features:
  • Example: building an editable makefile creator.

CHANGELOG:
  • Feb
...
Member
Posted in Uncategorized
Views 1200 Comments 0 rainbowsally is offline
Old

Computer Mad Science: The Anatomy Of A Makefile Part 1

Posted 01-28-2012 at 01:17 PM by rainbowsally

Features:
  • Anatomy of a Makefile

Requires:
  • an editor that can produce real TABs
  • make
  • And bash (with a 'B')... Not DASH, the Debian default shell, which can cause problems with some makefiles, especially on KDE sytems when trying to link
    libpthreads.

This might be interesting for even non-programmers, just to see how makefiles efficiently work through their dependencies.

[If you're already up to speed on what make does, skip to Part 2 and we'll create...
Member
Posted in Uncategorized
Views 21428 Comments 7 rainbowsally is offline
Old

To boot a broken openSUSE 11.4 (also dual-linux bootloader issues)

Posted 01-28-2012 at 03:31 AM by rainbowsally
Updated 08-06-2014 at 10:33 AM by rainbowsally

To boot a broken openSUSE system:

Use the DVD. (I am not online when I do this but it should work either way.)

1. Select "install" at the main menu, then when you get to the menu,

2. Select "update" <- IMPORTANT! If you don't click on 'update' it will destroy your home folders at the last step. Reboot (reset is fine here) if there's any question and run the installer again.

Evaluating the root partition is ok....
Member
Posted in Uncategorized
Views 1519 Comments 0 rainbowsally is offline
Old

KDE Utils: new.exec, shell-exec (for ENTER &amp; click on executables)

Posted 01-28-2012 at 03:08 AM by rainbowsally

[This post includes some test data showing what's wrong in KDE and a peek into the configuration files for various file types.]

Let's start with a program that writes programs. This is 'new.exec'.

file: new.exec (executable)
purpose: create a skeleton of a clickable shell program with an 'exec' extension.
Code:
#!/bin/sh
# creates a new exec file named $1.exec that does $2

name_exec="$1.exec"
cd_here='cd `dirname
...
Member
Posted in Uncategorized
Views 1549 Comments 0 rainbowsally is offline

  



All times are GMT -5. The time now is 06:35 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration