Sponsored Content
Top Forums UNIX for Advanced & Expert Users Detecting unused variables... Post 302973067 by wisecracker on Friday 13th of May 2016 01:10:25 PM
Old 05-13-2016
Detecting unused variables...

Hi guys...

The first active code line in AudioScope.sh is set -u .
This causes a complete exit if a variable is used/found but has not been allocated at the start of the program.

However, apart from writing code to do the task, is there a switch to to check which variables have been allocated but have not been used in the remainder of the code?

I have checked the WWW and there is nothing. I have also read the bash manual and can't see any reference.

iMac, OSX 10.11.4, bash version:-

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)
Copyright (C) 2007 Free Software Foundation, Inc.

Thanks In Advance...
 

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
CONFGET(1)						    BSD General Commands Manual 						CONFGET(1)

NAME
confget -- read a variable from a configuration file SYNOPSIS
confget [-cSx] [-N | -n] [-f filename] [-m pattern] [-P postfix] [-p prefix] [-s section] [-t type] varname... confget [-] [-N | -n] [-f filename] [-m pattern] [-P postfix] [-p prefix] [-s section] [-t type] -L pattern... confget [-] [-N | -n] [-f filename] [-m pattern] [-P postfix] [-p prefix] [-s section] [-t type] -l confget [-hTV] DESCRIPTION
The confget utility examines a INI-style configuration file and retrieves the value of the specified variables from the specified section. Its intended use is to let shell scripts use the same INI-style configuration files as other programs, to avoid duplication of data. The confget utility may retrieve the values of one or more variables, list all the variables in a specified section, list only those whose names or values match a specified pattern (shell glob or regular expression), or check if a variable is present in the file at all. It has a ``shell-quoting'' output mode that quotes the variable values in a way suitable for passing them directly to a Bourne-style shell. Options: -c Check-only mode; exit with a code of 0 if any of the variables are present in the configuration file, and 1 if there are none. -f filename Specify the configuration file to read from, or ``-'' (a single dash) for standard input. -h Display program usage information and exit. -L Variable list mode; display the names and values of all variables in the specified section with names matching one or more specified patterns. -l List mode; display the names and values of all variables in the specified section. -m pattern Only display variables with if their values match the specified pattern. -N Always display the variable name along with the value. -n Never display the variable name, only the value. -P postfix Display this string after the variable name as a postfix. -p prefix Display this string before the variable name as a prefix. -S Quote the variable values so that the ``var=value'' lines may be passed directly to the Bourne shell. -s section Specify the configuration section to read. If this option is not specified, confget will use the first section found in the configuration file. However, if the configuration file contains variable definitions before a section header, confget will only examine them instead. -T List the available configuration file types that may be selected by the -t option. -t type Specify the configuration file type. -V Display program version information and exit. -x Treat the patterns as regular expressions instead of shell glob patterns. ENVIRONMENT
Not taken into consideration. EXIT STATUS
If the -c option is specified, the confget utility will exit with a status of 0 if any of the specified variables exist in the config file and 1 if none of them are present. In normal operation, no matter whether any variables were found in the configuration file or not, the confget utility exits with a status of 0 upon normal completion. If any errors should occur while accessing or parsing the configuration file, the confget utility will display a diagnostic message on the standard error stream and exit with a status of 1. EXAMPLES
Retrieve the variable machine_id from the system section of a configuration file: confget -f h.conf -s system machine_id Retrieve the page_id variable from an HTTP GET request, but only if it is a valid number: confget -f- -t http_get -x -m '^+$' page_id Retrieve the variable hostname from the db section, but only if it ends in ``.ringlet.net'': confget -f h.conf -s db -m '*.ringlet.net' hostname Display the names and values of all variables in the system section with names beginning with ``mach'' or ending in ``name'', appending a ``cfg_'' at the start of each variable name: confget -f h.conf -s system -p 'cfg_' -L 'mach*' '*name' Display the names and values of all variables in the system section: confget -f h.conf -s system -l Safely read the contents of the db section: eval `confget -f h.conf -s db -p db_ -S -l` SEE ALSO
For another way to parse INI files, see the Config::IniFiles(3) Perl module. STANDARDS
No standards documentation was harmed in the process of creating confget. BUGS
Please report any bugs in confget to the author. AUTHOR
The confget utility was conceived and written by Peter Pentchev <roam@ringlet.net> in 2008. BSD
October 25, 2008 BSD
All times are GMT -4. The time now is 07:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy