04-29-2010
Quote:
Originally Posted by
arunkumar_mca
since we are using sh to execute this i thought the space might be the problem
That line is ignored as a comment in your case as already stated and anyway, this space is never a problem. That's the other way around. Having no space between "#!" and "/bin/interpreter" might be a problem with some old Unix implementations so it is always safer to put one here. In any case, that space can never cause a performance issue.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I need to take a string (stringA) check it for spaces and replace any spaces found with an equal (=) sign.
This is not working. There are spaces between each component:
$StringA | tr "" ""
The error returned is:
test: Specify a parameter with this command
Can you help? (3 Replies)
Discussion started by: by_tg
3 Replies
2. HP-UX
Hi,
I have small script written in korn shell. When it is called from different script, its dumping core, but no core dump when we run it standalone.
And its not dumping core if we run the script using "/bin/sh" instead of "ksh"
Can some body please help me how to resolve this issue.
... (9 Replies)
Discussion started by: simhe02
9 Replies
3. Shell Programming and Scripting
I am using ksh.. Whenever we write a shell script the first statement would be #! /bin/ksh. But instead of that I came to find "#@$-q large" in the first line and"#@$-s /usr/bin/ksh -x " in the second line. what does it mean?
Give your comments.....
Thanks
sabeer (4 Replies)
Discussion started by: sabeeralict
4 Replies
4. Shell Programming and Scripting
When ssh'ing into certain Unix boxes I'm seeing two errors that appear immediately after entering the password I've never seen. After the error message is displayed the connection closes immediately. The first is “/bin/ksh: Not owner” after which the connection is closed. And, “Read from remote... (5 Replies)
Discussion started by: twk
5 Replies
5. Shell Programming and Scripting
What does "-f" option do? This is at the start of a shell scripts to point to full path to the interpreter such as /bin/ksh
What does the -f option do?
#!/bin/ksh -f (3 Replies)
Discussion started by: Arsenalman
3 Replies
6. UNIX for Dummies Questions & Answers
what if the difference between
#!/bin/sh
and
#!/bin/bash
I wrote a script with the second heading now when i change my heading to the first one ...the script is not executing well....im not getting the required output....any solution to this problem...or do i have to start the... (3 Replies)
Discussion started by: xerox
3 Replies
7. Shell Programming and Scripting
Hi,
Could anyone please shed some light on the following script lines and what is it doing as it was written by an ex-administrator?
cat $AMS/version|read a b verno d
DBVer=$(/usr/bin/printf "%7s" $verno)
I checked that the cat $AMS/version command returns following output:
... (10 Replies)
Discussion started by: dbadmin100
10 Replies
8. Shell Programming and Scripting
there are two directories A and B
if cmd in in "A/user/bin A/bin A/user/sbin" but not "B/user/bin B/bin B/user/sbin" directory print them (1 Reply)
Discussion started by: yanglei_fage
1 Replies
9. Shell Programming and Scripting
I'm on Ubuntu 14.04 and I manually updated my coreutils so that "tee" is now on version 8.27
I was running a script using bash where there is some write to pipe error at some point causing the tee command to exit abruptly while the script continues to run. The newer version of tee seems to prevent... (2 Replies)
Discussion started by: stompadon
2 Replies
10. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT OPENSOLARIS
tcl_mem_debug
TCL_MEM_DEBUG(3TCL) Tcl Library Procedures TCL_MEM_DEBUG(3TCL)
__________________________________________________________________________________________________________________________________________________
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
ckalloc, memory, Tcl_ValidateAllMemory, Tcl_DumpActiveMemory
KEYWORDS
memory, debug
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWTcl |
+--------------------+-----------------+
|Interface Stability | Uncommitted |
+--------------------+-----------------+
NOTES
Source for Tcl is available on http://opensolaris.org.
Tcl 8.1 TCL_MEM_DEBUG(3TCL)