Sponsored Content
Top Forums UNIX for Advanced & Expert Users Has AudioScope found a bug in bash 4.4.5? Post 302998200 by wisecracker on Saturday 27th of May 2017 05:35:57 AM
Old 05-27-2017
Hi Corona688.

Still on a break with limited internet access but my 'ways are now changed'... ;o)
Well using the return method suits me fine.

I had no idea that this bug was near decades old and I was _exploiting_ it.
Thanks for pointing me in the right direction.

Here is a slightly simplified version of yours using dash as the prime mover.
OSX 10.12.5, default bash terminal calling 'dash' from the script...
I still get my variables where I want them so I am a happy bunny...
Code:
Last login: Sat May 27 10:20:46 on ttys000
AMIGA:amiga~> cd Desktop/Code/Shell
AMIGA:amiga~/Desktop/Code/Shell> cat kb_loop2.sh
#!/usr/local/bin/dash
# This passes the ShellCheck test as /bin/sh.
TEXT="Thank you Corona688."
status=0
KEYBOARD()
{
	printf "Enter QUIT to quit:- "
	read -r kbinput
	if [ "$kbinput" = "QUIT" ]
	then
		TEXT="YOU ARE HERE!"
		status=255
		echo "Exiting the KEYBOARD() function..."
                return 1
	elif [ "$kbinput" = "TEST" ]
	then
		echo "Hello World!"
	fi
        return 0
}
# Main loop...
while true
do
	echo "This will loop and hold until keyboard input is quitted."
	KEYBOARD
	if [ $? -eq 1 ]
	then
		break
	fi
done
echo "Now outside the loop..."
echo "$TEXT"
echo "Status = $status..."
AMIGA:amiga~/Desktop/Code/Shell> 
AMIGA:amiga~/Desktop/Code/Shell> 
AMIGA:amiga~/Desktop/Code/Shell> ./kb_loop2.sh
This will loop and hold until keyboard input is quitted.
Enter QUIT to quit:- NOTHING
This will loop and hold until keyboard input is quitted.
Enter QUIT to quit:- TEST
Hello World!
This will loop and hold until keyboard input is quitted.
Enter QUIT to quit:- QUIT
Exiting the KEYBOARD() function...
Now outside the loop...
YOU ARE HERE!
Status = 255...
AMIGA:amiga~/Desktop/Code/Shell> _

Thank you.
This User Gave Thanks to wisecracker For This Post:
 

8 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Have I found a bug?

When searching for new posts, I see that my voting in one of the polls counts as a 'new post'. However, while the '<blah> minutes ago' entry updates correctly, the 'by <username>' is the last user to actually post a comment in the poll instead. Result: Poll: vB Guest Book 39... (4 Replies)
Discussion started by: Smiling Dragon
4 Replies

2. Shell Programming and Scripting

bash-function with array acting bizarre, bug?

Hello, basically what this script is supposed to do is showing a list of hosts that is given a number, that you will be able to choose from a list. A check is made to verify that the chosen number is within the array and this is where things go bad and I don't know why, bizarre. I've spent... (5 Replies)
Discussion started by: gand
5 Replies

3. Shell Programming and Scripting

mv command not found bug

foreach x ( *.foo) echo "move file?" set move=$< if($move == y) then echo "enter new pathname:" set path=$< mv $x $path/$x endif end ok guys, im creating this script so i can move files with *.foo extensions and *.bar... (6 Replies)
Discussion started by: pantelis
6 Replies

4. Shell Programming and Scripting

bash:vi:command not found

I downloaded and installed "Cygwin yesterday onto my PC running Windows XP. When I tried to type "vi" in Cygwin's window, I got the following message bash: vi: Command not found What shud i do inorder to get into vi editor Thanks (10 Replies)
Discussion started by: bobby1015
10 Replies

5. UNIX for Dummies Questions & Answers

Im new to bash scriping and i found this expression on a bash script what does this mean.

# check host value regex='^(||1|2|25)(\.(||1|2|25)){3}$' if ')" != "" ]; then if ]; then echo host $host not found exit 4 fi elif ]; then echo $host is an invalid host address exit 5 fi espeacailly the top regex part? ---------- Post updated at 06:58 PM ---------- Previous update was... (1 Reply)
Discussion started by: kevin298
1 Replies

6. Shell Programming and Scripting

-bash-3.2$: not found

I am wondering if someone can help me out. I am new to oracle and given a task to install Oracle 11g on Solaris. I am running into some major problems since last week since I can't seem to get it to work. I can't start GUI, tried different blogs but no luck. Then, I decided to install it in a... (4 Replies)
Discussion started by: newborndba
4 Replies

7. What is on Your Mind?

AudioScope...

Boy oh boy, with only a MONO mic input to use AudioScope gets much more difficult when the ALTDC board is included. It needs, so far, two hits at the MIC input with a single hit at the HEADPHONE audio output. The first at the highest practical resolution for the AC component and the second... (0 Replies)
Discussion started by: wisecracker
0 Replies

8. OS X (Apple)

AudioScope Project.

AudioScope Project. (Apologies for any typos.) For the few following...... AudioScope.sh... Now at Version 0.60.00. Well this baby has come a long way since its inception in January 2013. It is now at Version 0.60.00. It is MUCH more Apple centric now with a new OSX Sierra minimum _silent_... (7 Replies)
Discussion started by: wisecracker
7 Replies
PIRL(1p)						User Contributed Perl Documentation						  PIRL(1p)

NAME
pirl - A read-eval-print loop in Perl (see Shell::Perl) SYNOPSIS
pirl pirl --noornaments pirl --version pirl -v EXAMPLE SESSION
$ pirl Welcome to the Perl shell. Type ':help' for more information pirl @> 1+1 2 pirl @> use YAML qw(Load Dump); () pirl @> $data = Load("--- { a: 1, b: [ 1, 2, 3] } "); { a => 1, b => [1, 2, 3] } pirl @> $var = 'a 1 2 3'; $var =~ /(w+) (d+) (d+)/ ("a", 1, 2) pirl @> :q DESCRIPTION
This script is the command-line interface to "Shell::Perl" which does it all. By now, read the fine details at "Shell::Perl" documentation. OPTIONS
--ornaments - turn on terminal ornaments (default) --noornaments - turn off terminal organments --version, -v - prints version info and exits with 0 SEE ALSO
Shell::Perl BUGS
Please report bugs via CPAN RT <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Shell-Perl>. AUTHOR
Adriano R. Ferreira, <ferreira@cpan.org> Caio Marcelo, <cmarcelo@cpan.org> COPYRIGHT AND LICENSE
Copyright (C) 2007aXX2011 by Adriano R. Ferreira This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2011-03-10 PIRL(1p)
All times are GMT -4. The time now is 03:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy