Sponsored Content
Full Discussion: Comments unexpectedly print
Top Forums Shell Programming and Scripting Comments unexpectedly print Post 302113977 by cfajohnson on Wednesday 11th of April 2007 07:47:29 PM
Old 04-11-2007
Quote:
Originally Posted by John H
Hmmmm I guess a few clues would have been helpful.
Via a process of elimination, I tracked the problem to the following line:
echo "\"$location $plant $desig $quantity\ " $rid"
After this statement all comments where echoed to the screen and echo didnt work.
For example echo $func would not show the content of func
Once I commented the line out - problem gone - so I presume there is something in the syntax of that one particular line that caused the problem.

There's a space after the second backslash, so that the quote is not escaped. It should (presumably) be:

Code:
echo "\"$location $plant $desig $quantity\" $rid"


Last edited by cfajohnson; 04-11-2007 at 08:51 PM.. Reason: Typo
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Print comments in FTP

Dear Unix Gurus, Not sure if this is possible/workable but I'm trying add a comment line before each operation such as the following: ftp -n <mail server> ${log_dir}/test_put.log << END user <user_id> <password> verbose bin # List Files Before putting Data echo File Check Before FTP >>... (7 Replies)
Discussion started by: lweegp
7 Replies

2. Shell Programming and Scripting

script unexpectedly terminating

I now that this isnt the greatest code around. Im a network guy by trade not a programer .. but needed something to compare config files ... Anyway ... intermittently, the program terminates. Ive been looking at the code for a week trying to figure it out and Im stumped. Can anyone provide... (0 Replies)
Discussion started by: popeye
0 Replies

3. Shell Programming and Scripting

Gawk combining lines unexpectedly

I am attempting to combine sections of log that should be one line but are spaced out over 10-30 lines due to how the software is outputting the info. (If I am making a newbie mistake I apologize) Example of log I am working with: 2009-04-14 14:51:22 access data here info. Info. Info. ……..... (4 Replies)
Discussion started by: demanche
4 Replies

4. Shell Programming and Scripting

tr command behaving unexpectedly

Im trying to execute the below command on our server to list files and replace the newline in the file list with spaces, but the character 'n' is getting replaced with a space, is there any environment variable that needs to be set in UNIX? sh -c 'ls -trx... (1 Reply)
Discussion started by: rameshrr3
1 Replies

5. Shell Programming and Scripting

Sed script, changing all C-comments to C++-comments

I must write a script to change all C++ like comments: // this is a comment to this one /* this is a comment */ How to do it by sed? With file: #include <cstdio> using namespace std; //one // two int main() { printf("Example"); // three }//four the result should be: (2 Replies)
Discussion started by: black_hawk
2 Replies

6. Shell Programming and Scripting

print only comments

I want to write a shell script which it takes as argument a java file or a c++ file (.java or .cpp). It will check if the file is type of java or c++, else it ends with error message. If all are ok, it will call awk that prints only the comments that the java or c++ file contains, grouping and... (5 Replies)
Discussion started by: Mark_orig
5 Replies

7. UNIX for Dummies Questions & Answers

Machine shutdown unexpectedly

Hi One of our Linux box got shutdown unexpectedly . I have noticed that 4 out of 8 nic ports were not blinking . I m not sure where to search logs . Any help would be appreciated. Please find the var/log/message Is it a case of power failure as nothing specific is getting logged(Just a... (7 Replies)
Discussion started by: pinga123
7 Replies

8. Red Hat

Server rebooting unexpectedly

hi, I have been working on Solaris am very new to linux. My concern is as it goes....our server is getting rebooted automatically and I am not able to understand anything from the var log messages. Could anybody help me out in troubleshooting the issue. 2.6.18-128.el5 #1 x86_64 GNU/Linux is... (1 Reply)
Discussion started by: EmbedUX
1 Replies

9. UNIX for Dummies Questions & Answers

System got restarted unexpectedly

One of our Host server got restarted unexpectedly and all we got is this. Not able to guess the root cause behind this .Please help. Before restart Oct 17 19:56:06 SERVER1 kernel: suspend: event channel 75 Oct 17 19:56:10 SERVER1 smartd: smartd version 5.38 Copyright (C) 2002-8 Bruce... (3 Replies)
Discussion started by: pinga123
3 Replies
echo(3XCURSES)						  X/Open Curses Library Functions					    echo(3XCURSES)

NAME
echo, noecho - enable/disable terminal echo SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int echo(void); int noecho(void); DESCRIPTION
The echo() function enables Echo mode for the current screen. The noecho() function disables Echo mode for the current screen. Initially, curses software echo mode is enabled and hardware echo mode of the tty driver is disabled. The echo() and noecho() functions control soft- ware echo only. Hardware echo must remain disabled for the duration of the application, else the behavior is undefined. RETURN VALUES
Upon successful completion, these functions return OK. Otherwise, they return ERR. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
getch(3XCURSES), getstr(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), scanw(3XCURSES), attributes(5), standards(5) SunOS 5.11 5 Jun 2002 echo(3XCURSES)
All times are GMT -4. The time now is 11:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy