Exactly, I get parameter with correct order , but seems if (s) had problems!
Do you have idea about that part of code?
Quote:
Originally Posted by eckertd
This may help you figure out your logic:
In your 'for' loop:
"var" is going to start with arg1 and get reassigned to the next in the list each iteration until argn
"T1" is always going to be arg1
"T2" is always going to be arg2
How can I use a variable that has the conditions for the if statement stored in it?
my test script
condition=" || || "
if "$condition"
then echo "true"
else echo "false"
fi
output
$ ./test2.sh
./test2.sh: line 3: || || : command not found
false (2 Replies)
Hi All,
I am trying to check if two variables have value assigned to it.
i am doing it like
if ]
then
echo "Please specify either single hostname or host file for the report"
usage
exit
fi
But its not working for it.Even i specify values for both variables it dont go... (6 Replies)
Hi, I have meaning to include an if condition statement in my code to check the directory for existing output files and if its existing i want the program to delete it before doing the succeeding command. i just dont know the correct syntax for it. thanks much guys, this forum has indeed been very... (4 Replies)
Urgent help with bash scripting
1- i am using grep to find a string called: tinker panic 0 in a file /etc/ntp.conf
if the string is not there, i want to add the strings in /etc/ntp.conf file in the first line of the file. if not do nothing or exit.
2- also i want to add # in front of the... (2 Replies)
I want to check (using bash condition test function) if string contains three spaces, ignoring last three spaces at the end of string.
string_to_report='foo bar foo bar '
string_to_ignore='foo bar ' (8 Replies)
In the below I can not seem to add a line that will add Not low if the statement in bold is not true or meet. I guess when the first if statement is true/meet then print low, otherwise print Not low in $(NF + 1). I am not sure how to correctly add this. Thank you :).
if(low <= $2 && $2 <=... (5 Replies)
Hi,
I need to perform the untar and rm operation if the file found is a .tar and does not have test.tar or hello.tar as the file names.
Below is the loop to check the same.
for tf in *.tar
do if ]
then found=1
... (1 Reply)
I wrote a code to find codons in a DNA string. The only problem I have is how do I make the code only work for a file with DNA. This means the file only has the characters a,c,g,t and no white space characters. (3 Replies)
Hi.
I wrote this small bash script, i want to compare second column from file1 with file2 if a pattern matches. Files are small and I am sure that pattern occurs only once. I think this can be rewritten into a awk one liner. Appreciate if someone could give me idea. Whole NR FNR confuse me :o
... (6 Replies)
Discussion started by: ctrld
6 Replies
LEARN ABOUT CENTOS
afquerydouble
AFQUERY(3)AFQUERY(3)NAME
afQuery, afQueryLong, afQueryDouble, afQueryPointer - query the capabilities of the Audio File Library
SYNOPSIS
#include <audiofile.h>
AUpvlist afQuery (int querytype, int arg1, int arg2, int arg3, int arg4);
long afQueryLong (int querytype, int arg1, int arg2, int arg3, int arg4);
double afQueryDouble (int querytype, int arg1, int arg2, int arg3,
int arg4);
void *afQueryPointer (int querytype, int arg1, int arg2, int arg3,
int arg4);
PARAMETERS
querytype can be one of the following:
o AF_QUERYTYPE_FILEFMT
o AF_QUERYTYPE_INST
o AF_QUERYTYPE_INSTPARAM
o AF_QUERYTYPE_COMPRESSION
o AF_QUERYTYPE_COMPRESSIONPARAM
o AF_QUERYTYPE_MISC
o AF_QUERYTYPE_MARK
o AF_QUERYTYPE_LOOP
arg1, arg2, arg3, and arg4 are integer selectors whose meaning depends upon querytype.
RETURN VALUE
Upon success, afQuery will return a non-null AUpvlist value. Upon failure, afQuery will return null while afQueryLong and afQueryDouble
will return -1 and afQueryPointer will return null.
Pointers representing character strings are owned by the Audio File Library and must not be freed; all other pointer values must be freed
by the caller.
DESCRIPTION
For AF_QUERYTYPE_FILEFMT, the following selectors are valid values for arg1:
AF_QUERY_LABEL
Request a short label string for the format (e.g., "aiff").
AF_QUERY_NAME
Request a short name for the format (e.g., "MS RIFF WAVE").
AF_QUERY_DESC
Request a descriptive name for the format (e.g., "Audio Interchange File Format").
AF_QUERY_IMPLEMENTED
Request a boolean value indicating whether the format is implemented for reading and writing in the Audio File Library.
AF_QUERY_ID_COUNT
Request the total number of formats implemented.
AF_QUERY_IDS
Request an integer array of the id token values of all implemented file formats.
AF_QUERY_COMPRESSION_TYPES
Used with the selector AF_QUERY_VALUE_COUNT in arg2, this will return a long integer containing the number of compression schemes
available for use within the format specified in arg3. Used with selector AF_QUERY_VALUES, it returns a pointer to an integer array
containing the compression id values of the compression schemes supported by the format specified in arg3.
AF_QUERY_SAMPLE_FORMATS
Used with the selector AF_QUERY_DEFAULT in arg2, this will return the default sample format for the file format specified in arg3.
AF_QUERY_SAMPLE_SIZES
Used with selector AF_QUERY_DEFAULT in arg2, this will return the default sample width for the file format specified in arg3.
For AF_QUERYTYPE_INST, the following selectors are valid for arg1:
AF_QUERY_SUPPORTED
Request a boolean value indicating whether the file format in arg2 supports instruments.
AF_QUERY_MAX_NUMBER
Request an integer value indicating the maximum number of instruments supported by the file format in arg2.
For AF_QUERYTYPE_INSTPARAM, the following selectors are valid for arg1:
AF_QUERY_SUPPORTED
Request a boolean value indicating whether the file format in arg2 supports instrument parameters.
AF_QUERY_ID_COUNT
Request an integer value indicating the number of instrument parameters supported by the file format in arg2.
AF_QUERY_IDS
Request an integer array containing the instrument parameter values for the file format in arg2.
AF_QUERY_TYPE
For the file format in arg2, request the type of the instrument parameter in arg3.
AF_QUERY_NAME
For the file format in arg2, request the name of the instrument parameter in arg3.
AF_QUERY_DEFAULT
For the file format in arg2, request the default value of the instrument parameter in arg3.
ERRORS
afQuery can produce the following errors:
AF_BAD_QUERYTYPE
The query type is unsupported.
AF_BAD_QUERY
The arguments to the query are bad.
AUTHOR
Michael Pruett <michael@68k.org>
Audio File Library 0.3.6 03/06/2013 AFQUERY(3)