Sponsored Content
Top Forums Shell Programming and Scripting awk and Unary Operators in Bash Post 303013597 by kristinu on Saturday 24th of February 2018 04:30:11 AM
Old 02-24-2018
It was quite difficult to find the problem with the code though.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk returning "[: ==: unary operator expected"

Hi All, I am new to shell scripting and right now I am just limited to using the pre-written scripts. I am in to Infrastructure management where we use different scripts to get the information passed on to the monitoring tools. I am trying to use this script to get the information about the... (2 Replies)
Discussion started by: theamrit
2 Replies

2. Shell Programming and Scripting

unary operator expected

Im trying to fix my /etc/weekly that rotates various logs however it does them no matter what filesize they are and i want them to only do it if there file size exceeds 2M or something. So I'm playing with a script to get the filesize using a ls -l command which works and puts the value into a... (3 Replies)
Discussion started by: timgolding
3 Replies

3. Shell Programming and Scripting

Can you use logical operators in a case statement (bash)?

I'm pretty sure I already know the answer to this, but I want to make sure I'm not overlooking anything. I'm working on a log monitoring script and every 10 lines I want to display a summary of events. The thing is, there are a lot of possible events, that likely won't have happened, so I only want... (0 Replies)
Discussion started by: DeCoTwc
0 Replies

4. Shell Programming and Scripting

BASH - set specific user variable via string operators

Apologies for the utter triviality of this question, but we all have to start somewhere! I've also tried searching but this question is pretty vague so I didn't (a) really know what to search for or (b) get many relevant hits to what I did search for. Anyway, I'm in the process of self-teaching... (1 Reply)
Discussion started by: u5j84
1 Replies

5. Shell Programming and Scripting

unary operator is missing

hi , i m getting an error unary operator is missing. pls check why is this so? i=5 while test $i !=0 do echo $i i=`expr $i - 1` done (3 Replies)
Discussion started by: angel12345
3 Replies

6. Programming

Need help and explanation on Unary operators

Hello guys. It's orszhak and since I'am starting in programming in c++ I again have stumbled upon something. While I was reading my book it talked about unary operators. I understood that they consist of +, -,++,--. I just want to know what do they do and how do they work. Plus it also talked of... (1 Reply)
Discussion started by: orszhak
1 Replies

7. UNIX for Beginners Questions & Answers

Bash -o -v -R operators

I do not know the use of the -o -v -R operators. This is what the info says and I am confused of what optname and varname mean, are they just normal variable? -o optname True if the shell option optname is enabled. See the list of options under the ... (6 Replies)
Discussion started by: kristinu
6 Replies

8. Shell Programming and Scripting

Bash variable assignment failure/unary operator expected

I have a little code block (executing on AIX 7.1) that I cannot understand why the NOTFREE=0 does not appear to be assigned even though it goes through that block. This causes a unary operator issue. #!/bin/bash PLATFORM="AIX" NEEDSPC=3000 set -x if ; then lsvg | grep -v rootvg | while... (6 Replies)
Discussion started by: port43
6 Replies

9. Shell Programming and Scripting

awk conditional operators- lookup value in 2nd file

I use conditional operators alot in AWK to print rows from large text files based on values in a certain column. For example: awk -F '\t' '{ if ($1 == "A" || $1 == "C" ) print $0}' OFS="\t" file1.txt > file2.txt In this case every row is printed from file1 to file2 for which the column 1... (5 Replies)
Discussion started by: Geneanalyst
5 Replies
TCL_MEM_DEBUG(3)					      Tcl Library Procedures						  TCL_MEM_DEBUG(3)

__________________________________________________________________________________________________________________________________________________

NAME
TCL_MEM_DEBUG - Compile-time flag to enable Tcl memory debugging. DESCRIPTION
When Tcl is compiled with TCL_MEM_DEBUG defined, a powerful set of memory debugging aids are included in the compiled binary. This includes C and Tcl functions which can aid with debugging memory leaks, memory allocation overruns, and other memory related errors. ENABLING MEMORY DEBUGGING
To enable memory debugging, Tcl should be recompiled from scratch with TCL_MEM_DEBUG defined. This will also compile in a non-stub version of Tcl_InitMemory to add the memory command to Tcl. TCL_MEM_DEBUG must be either left defined for all modules or undefined for all modules that are going to be linked together. If they are not, link errors will occur, with either TclDbCkfree and Tcl_DbCkalloc or Tcl_Ckalloc and Tcl_Ckfree being undefined. Once memory debugging support has been compiled into Tcl, the C functions Tcl_ValidateAllMemory, and Tcl_DumpActiveMemory, and the Tcl mem- ory command can be used to validate and examine memory usage. GUARD ZONES
When memory debugging is enabled, whenever a call to ckalloc is made, slightly more memory than requested is allocated so the memory debug- ging code can keep track of the allocated memory, and eight-byte ``guard zones'' are placed in front of and behind the space that will be returned to the caller. (The sizes of the guard zones are defined by the C #define LOW_GUARD_SIZE and #define HIGH_GUARD_SIZE in the file generic/tclCkalloc.c -- it can be extended if you suspect large overwrite problems, at some cost in performance.) A known pattern is writ- ten into the guard zones and, on a call to ckfree, the guard zones of the space being freed are checked to see if either zone has been mod- ified in any way. If one has been, the guard bytes and their new contents are identified, and a ``low guard failed'' or ``high guard failed'' message is issued. The ``guard failed'' message includes the address of the memory packet and the file name and line number of the code that called ckfree. This allows you to detect the common sorts of one-off problems, where not enough space was allocated to con- tain the data written, for example. DEBUGGING DIFFICULT MEMORY CORRUPTION PROBLEMS
Normally, Tcl compiled with memory debugging enabled will make it easy to isolate a corruption problem. Turning on memory validation with the memory command can help isolate difficult problems. If you suspect (or know) that corruption is occurring before the Tcl interpreter comes up far enough for you to issue commands, you can set MEM_VALIDATE define, recompile tclCkalloc.c and rebuild Tcl. This will enable memory validation from the first call to ckalloc, again, at a large performance impact. If you are desperate and validating memory on every call to ckalloc and ckfree isn't enough, you can explicitly call Tcl_ValidateAllMemory directly at any point. It takes a char * and an int which are normally the filename and line number of the caller, but they can actually be anything you want. Remember to remove the calls after you find the problem. SEE ALSO
memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory KEYWORDS
memory, debug Tcl 8.1 TCL_MEM_DEBUG(3)
All times are GMT -4. The time now is 01:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy