Detecting unused variables...


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Detecting unused variables...
# 15  
Old 06-13-2016
POSIX compliance is a little high to shoot for when storing binary data inside shell variables, you're not going to get it. This is a BASH script and liable to stay that way. But it can be made a better BASH script.

The question isn't really about compliance, it's about avoiding unintended problems. printf "$randomstring" will mess up whenever $randomstring contains an unintentional % character as those have special meaning to printf. pritnf "%s" "$string" avoids this, but at the cost of not expanding "\x" sequences etc inside $string.
# 16  
Old 07-04-2016
Hi guys...

Sorry about the long delay, I am a carer now for my mother so get very little time to do anything WRT programming.

I don't think AudioScope.sh is capable of being purely 'shell', (sh), able because of the 'read' statement.

I need the '-t[secs]' argument and reading the POSIX information on here the 'shell' will only allow the '-r' argument.

It also looks like 'bash' is not recognised either or I may be missing something.

So I will be cleaning up the code to suit current methods and 'bash' only, much of which I have already done.

Thanks for the input...

Another AudioScope.sh upload soon.
# 17  
Old 07-04-2016
Hi.

On an old Mac:
Code:
OS, ker|rel, machine: Apple/BSD, Darwin 9.8.0, Power Macintosh
Distribution        : Mac OS X 10.5.8 (leopard, workstation)
bash GNU bash 3.2.17

I see in man bash:
Code:
read [-ers] [-u fd] [-t timeout] [-a aname] [-p prompt] [-n nchars] [-d delim] [name ...]

However, you might find useful:
Code:
qprompt, timer, specific characters, prompt-string, etc.; in c
           http://www.ibiblio.org/pub/historic-linux/ftp-archives/sunsite.unc.edu/Nov-06-1994/utils/shell/qprompt-2.3.tar.gz
           ( Verified 2016.06.20, compiles with warning, worked in 64-bit )

Best wishes ... cheers, drl
# 18  
Old 07-06-2016
Hi drl...

With the pointer to ShellCheck giving more than required by this thread and does what I need then this thread is solved.

Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. AIX

how to clean Unused semaphore??

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

7. 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

8. 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

9. 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
Login or Register to Ask a Question