Linux:BASH

From My notepad
Jump to: navigation, search

Contents

Bash topics

Bash Reference Manual - Hosted at Gnu.org

Bash Scripting Tutorial - Hosted at LinuxConfig.org

Viewing current bash session history

history

xon/xoff

Source: [1]

> If press Ctrl-S in rxvt running bash and then the bash becomes inactive,
> i.e. does not response to any key stroke. I have to open another rxvt
> and kill -9 <pid>.  Is this a feature or a bug?  I found that in the dos
> prompt box bash is never affected by the ctrl-s.

Ever heard of XON/XOFF  ASCII characters?

 XOFF - stop transmitting   (CTRL-S in many cases)
 XON  - start transmitting  (CTRL-Q in many cases)

 Try CTRL-Q when your "bash becomes inactive"

/Hannu E K Nevalainen, B.Sc. EE - 59?16.37'N, 17?12.60'E
-- UTC+1, GMT+1, CET --
--END OF MESSAGE-- 

Terminal Still Alive

The script below will print characters on the terminal and ding the terminal every 30 seconds to let you know the remote server is still alive.

#!/bin/bash

COUNTER=0

while true; do
	echo -n "="
	sleep 1
	COUNTER=$(($COUNTER + 1))
	if [ $COUNTER -eq 30 ]; then
		COUNTER=0
		echo -n -e "\007"
		echo ">"
	fi
done

Personal tools