Sponsored Content
Top Forums UNIX for Advanced & Expert Users Detecting unused variables... Post 302974874 by wisecracker on Sunday 5th of June 2016 08:43:41 AM
Old 06-05-2016
Hi all...
(Apologies for the delay but I have had other commitments. Also for any typos.)

@bakunin...
(Have you tried the code out at all to see what it does?)

1) I am not a software engineer, but a retired, mere amateur. ;o)
2) This project was for me to learn shell scripting, of which I know much more now than day one.
3) There are many functions inside the program that can't really be made simpler than they are and there are also some simple ones called regularly.
4) There are a lot of variables and all are used, there are no extras that have been found. I like _bash_'s flexibiilty and things that It, along with the Terminal, can do makes life interesting. Along the way I have discovered some strange effects of the hardware that I and I suspect nearly everyone else did not know.
5) Lastly a rewrite of the code would be difficult as it has evolved to become a tool that even I could not have imagined - back at the start of this project I bragged about doing this but never in my wildest dreams did I expect it to get where it is. It HAS had a write up in Linux Format Magazine and this is a shock to the system to say the least.
6) Fimally this script does everything EXCEPT build the external hardware for you...
A) Although unfinished, contains the circuits; so far.
B) Generates ALL necessary files plus have extras that you can use elsewhere as .WAV files.
C) Creates a working Audio Oscilloscope using text mode inside a terminal without the need for fancy graphics.
D) Uses 3 dedicated capture modes, along with 3 other modes that are platform specific.
E) Uses ONLY the mic/ear socket of an MBP 13 inch OSX 10.7.5 using the default bash terminal.
F) It has evolved over time.
G) And LBNL, I don't think this has ever been attempted anywhere elsebefore.
H) Capable of doing both AC and DC measurements to a minimum of 4 - 5 bit depth.
I) Other things that elude me at the moment.

It is designed to run on hopefully UNIX, definitely various Linux flavours in both 32 and 64 bit guises, CygWin and CygWin64 and MBP/iMac OSX 10.7.x minimum.

So to finalise, you have not annoyed me but it would be very difficult to start again with my current knowledge so I am coding this in its original coding style.

A listing of the files generated for the current version:-
Code:
-rw-r--r--  1 barrywalker  wheel  48000  5 Jun 13:14 0000000000.BIN
-rwxr--r--  1 barrywalker  wheel    503  5 Jun 13:14 1KHz-Test.sh
-rw-r--r--  1 barrywalker  wheel  80272  5 Jun 13:15 AudioScope.Manual
-rw-r--r--  1 barrywalker  wheel    327  5 Jun 13:15 AudioScope.config
-rw-r--r--  1 barrywalker  wheel    253  5 Jun 13:14 VERT_BAT.BAT
-rw-r--r--  1 barrywalker  wheel    295  5 Jun 13:14 VERT_DSP.sh
-rw-r--r--  1 barrywalker  wheel    336  5 Jun 13:14 VERT_SOX.sh
-rw-r--r--  1 barrywalker  wheel      1  5 Jun 13:14 dcdata.raw
-rw-r--r--  1 barrywalker  wheel  65580  5 Jun 13:15 pulse.wav
-rw-r--r--  1 barrywalker  wheel  65580  5 Jun 13:14 pulse1.wav
-rw-r--r--  1 barrywalker  wheel  65580  5 Jun 13:14 pulse2.wav
-rwxr-xr-x  1 barrywalker  wheel      1  5 Jun 13:14 pulsetest.sh
-rw-r--r--  1 barrywalker  wheel  48000  5 Jun 13:14 sample.raw
-rw-r--r--  1 barrywalker  wheel      1  5 Jun 13:14 signed16bit.txt
-rw-r--r--  1 barrywalker  wheel  65536  5 Jun 13:14 sinewave.raw
-rw-r--r--  1 barrywalker  wheel  65580  5 Jun 13:14 sinewave.wav
-rw-r--r--  1 barrywalker  wheel   8000  5 Jun 13:14 squarewave.raw
-rw-r--r--  1 barrywalker  wheel  65096  5 Jun 13:14 sweep.raw
-rw-r--r--  1 barrywalker  wheel  65140  5 Jun 13:14 sweep.wav
-rw-r--r--  1 barrywalker  wheel  32548  5 Jun 13:14 sweeper.raw
-rw-r--r--  1 barrywalker  wheel   8000  5 Jun 13:14 symmetricalwave.raw
-rw-r--r--  1 barrywalker  wheel  48000  5 Jun 13:15 waveform.raw
-rw-r--r--  1 barrywalker  wheel  65580  5 Jun 13:14 waveform.wav

@Corona688...
OK, maybe backwards compatibilty is not the phrase to use, however I do test on various platforms. Several Linux flavours using live DVDs, iMac and MBP, CygWin and CygWin64 of which the latter did show up a bug NOT even related to printf . I have even used the 'printf' inside /usr/bin/printf which does NOT allow escaped hex values but only octal ones but decided that the hex ones looked neater.

I would like professional opinions on trying it out in their UNIX flavours however, even if you don't like it.

And finally the variables are all used and none are detected as not being allocated during program run.

I hope this clears it up and the next upload will be the AC condition finalised with builds and calibration of the AC vertical axis.

The DC conditions will be much harder, Arduino and the first home built 'ALTDC' are done and coded for but not calibrated yet.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do I get the unused space?

One of my Solaris 8 machines hd was about to die. So I used g4u to create an image of the 9gb drive and I put it in a 36gb drive. That solved my dieing hd problem. But.... How do I get my machine to see the unused 27gb of space? Any help would be greatly appreciated. (1 Reply)
Discussion started by: Spyzic
1 Replies

2. AIX

unused storage on AIX 4.3

Hi, How do I query for unused partition in AIX 4.3 with DAS and SAA storage? I know most unix administrator don't put all the capacity on the system at once. thanks, vene (1 Reply)
Discussion started by: venerayan
1 Replies

3. UNIX for Dummies Questions & Answers

delete the unused file

Hi All, Can you please let me know how to delete any files that have not been accessed in the past 28 days in a directory. Thanks, Arun (3 Replies)
Discussion started by: arunkumar_mca
3 Replies

4. AIX

how to clean Unused semaphore??

How can i clean up my unused semaphore??? (4 Replies)
Discussion started by: abhishek27
4 Replies

5. HP-UX

HP-UX using unused HDD space

Hello, I have a system with HP-UX 11.23 installed on it. There are ~36GB of unused space on the HDD. I did a very basic installation, and it created the usual volume group /dev/vg00. When I look at the output of ioscan -funC disk, I see this (and more, but irrelevant to this post): disk ... (1 Reply)
Discussion started by: goon12
1 Replies

6. Solaris

unused disk space

i Have alloted 20G in my vmware for solaris 10, upon installation, and some distribution of disk space to /,/opt,swap i just use 19G. Can i still use the 1G? How? how to see the 1G? that i did not use? how can i use it? appreciate your responce (17 Replies)
Discussion started by: kenshinhimura
17 Replies

7. AIX

Temporarily disabling unused ethernet adapter

Hi, In our AIX 5.2 server , we have one unused ethernet adapter which doesn't have cable connection . For this interface , we are getting alerts in errpt . Could you suggesthow to stop this alert ? And sametime i would like to keep this device in ODM . Is there... (1 Reply)
Discussion started by: sekarsamy
1 Replies

8. Programming

What Unix do with unused shared memory?

Hello, When creating shared memory in C, should be remove shared memory with shmctl function when don't need it. If it didn't remove, occupied shared memory stay and remain. If we create shared memory repeatedly without removing unusable shared memory, /dev/shm will full. Does Unix or... (1 Reply)
Discussion started by: pronetin
1 Replies

9. Solaris

Solaris 10: how to disable an unused HBA card

Dear all, I have a new Oracle Blade X4-2B server, running Solaris 10. The server comes with a HBA card that will not be used now. It has not fibers connected to it. As a consequence, its leds never stop flashing. My question is: how to disable this HBA card, without removing it physically... (2 Replies)
Discussion started by: Gus1971
2 Replies
All times are GMT -4. The time now is 07:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy