I'm having a strange problem with escaping double-quotes. I have a script that looks like this:
#!/bin/bash
for HOST in `cat $INFILE | grep -v ^#`
do
for VFILER in `some_command`
do
echo " "
echo -e '\E
The problem with ssh command... (3 Replies)
I have a csv file with lines like the followings
123456,"ABC CO., LTD","XXX"
789012,"DEF LIMITED", "XXX"
before I bcp this file to database, the comma in "CO.," need to be removed first.
My script is cat <filename> | sed 's/"CO.,"/"CO."/g'
but it doesn't work. Can anyone here able to... (2 Replies)
Hi
I have the following assignment in my ksh script:
PX_LIST="4119 2390 2294 2776 2897 4099"
Is there any sed/awk command which would allow the to remove certain number from this string. Let's say I need to remove PX=2390 from PX_LIST, so the output after deletion will be"
PX_LIST="4119 2294... (5 Replies)
Hi Experts,
How to ignore any delimiters which is inside the quotes. in awk script.
I am having script which counts number of delimiters from the line now i need count delimiters only separators .
`grep "14" | cut -d"=" -f2` -F'~'if (NF-1 != v1) '
this command counts number of Tilde... (7 Replies)
Hi all,
My code reads:
foldername=$(basename $PWD)
myvar=$(rm -v `ls | grep -vE 'file1|file2|$foldername.ext'` | wc -l)
echo "Removed $myvar files"
The thing is $foldername won't pick the value stored in 'foldername'. My guess is that the single-quotes are making it read $foldername... (2 Replies)
I have a script which outputs some timing data a line at a time. There are approx. 10 lines echoed, each line looks something like this:
0.741 http://checkip.dyndns.org 94.170.119.226Since I needed to add all the values in the first column, I piped the output to grep, matching and printing the... (7 Replies)
Hi,
I have an input file like this
$ cat infile
hi,i,"am , sam", y
hello ,good, morning
abcd, " ef, gh " ,ij
no, "good,morning", yes, "good , afternoon"
from this file I have to split the fields on basis of comma"," however, I the data present inside double qoutes should be treated as... (3 Replies)
i try to find way to make string concatenation in csh ( sorry this is what i have )
so i found out i can't do :
set string_buff = ""
foreach line("`cat $source_dir/$f`")
$string_buff = string_buff $line
end
how can i do string concatenation? (1 Reply)
Hi All,
I want to replace the commas which are not inside parenthesis,quotes
if input is
abc,,lm,(no,pq,rs),{tu,vw,xy},zs,"as,as,fr",'ab,cd,ef'
output should be
abc lm (no,pq,rs) {tu,vw,xy} zs "as,as,fr" 'ab,cd,ef'
I tried this str.replaceAll("\\(.*?\\)|(,)", " "); say my string... (3 Replies)
Please use code tags
Hi,
I have input data is below format and n of column in the multiple flat files. the string data has any double quotes(") values replaced to double double quotes for all the columns{"").
Also, my input flat file each column string data has carriage of new line too.... (14 Replies)
Discussion started by: SSrini
14 Replies
LEARN ABOUT SUSE
puts
puts(n) Tcl Built-In Commands puts(n)
__________________________________________________________________________________________________________________________________________________NAME
puts - Write to a channel
SYNOPSIS
puts ?-nonewline? ?channelId? string
_________________________________________________________________DESCRIPTION
Writes the characters given by string to the channel given by channelId.
ChannelId must be an identifier for an open channel such as a Tcl standard channel (stdout or stderr), the return value from an invocation
of open or socket, or the result of a channel creation command provided by a Tcl extension. The channel must have been opened for output.
If no channelId is specified then it defaults to stdout. Puts normally outputs a newline character after string, but this feature may be
suppressed by specifying the -nonewline switch.
Newline characters in the output are translated by puts to platform-specific end-of-line sequences according to the current value of the
-translation option for the channel (for example, on PCs newlines are normally replaced with carriage-return-linefeed sequences. See the
fconfigure manual entry for a discussion on ways in which fconfigure will alter output.
Tcl buffers output internally, so characters written with puts may not appear immediately on the output file or device; Tcl will normally
delay output until the buffer is full or the channel is closed. You can force output to appear immediately with the flush command.
When the output buffer fills up, the puts command will normally block until all the buffered data has been accepted for output by the oper-
ating system. If channelId is in nonblocking mode then the puts command will not block even if the operating system cannot accept the
data. Instead, Tcl continues to buffer the data and writes it in the background as fast as the underlying file or device can accept it.
The application must use the Tcl event loop for nonblocking output to work; otherwise Tcl never finds out that the file or device is ready
for more output data. It is possible for an arbitrarily large amount of data to be buffered for a channel in nonblocking mode, which could
consume a large amount of memory. To avoid wasting memory, nonblocking I/O should normally be used in an event-driven fashion with the
fileevent command (do not invoke puts unless you have recently been notified via a file event that the channel is ready for more output
data).
EXAMPLES
Write a short message to the console (or wherever stdout is directed):
puts "Hello, World!"
Print a message in several parts:
puts -nonewline "Hello, "
puts "World!"
Print a message to the standard error channel:
puts stderr "Hello, World!"
Append a log message to a file:
set chan [open my.log a]
set timestamp [clock format [clock seconds]]
puts $chan "$timestamp - Hello, World!"
close $chan
SEE ALSO
file(n), fileevent(n), Tcl_StandardChannels(3)KEYWORDS
channel, newline, output, write
Tcl 7.5 puts(n)