Hi,
I have script which will take a string as input and search in a file.
But when I want to search a pattern which has special characters script is ignoring it.
For example: I want to search a pattern "\.tumblr\.com". shell script is removing \ (backslah) and trying to search... (7 Replies)
Hi ,
I am having an issue with the Awk script to insert newline for a regular expression match
Having a file like this
FILE1
####################
RXOER , RXERA , RXERC , RXERD
.RXEA(RXBSN), RXERD , REXCD
input RXEGT
buffer RXETRY
#######################
Want to match the RXE... (38 Replies)
Hi all,
How am I read a file, find the match regular expression and overwrite to the same files.
open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat";
open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat";
while (<DESTINATION_FILE>)
{
# print... (1 Reply)
hi
i am trying to extract some specific data out of a text file using regular expressions with shell script
that is using a multiline grep .. and the tool i am using is pcregrep so that i can get compatibility with perl's regular expressions
for a sample data like this, i am trying to grab... (6 Replies)
Hello All,
I'm trying to extract the lines between two consecutive elements of an array from a file.
My array looks like:
problem_arr=(PRS111 PRS213 PRS234)
j=0
while } ]
do
k=`expr $j + 1`
sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt
---some operation goes... (11 Replies)
I do have a shell file where I call many unix commands . I would like to add a regular expression step in that shell file, where a text file, say Test.txt has to be openned and all the :'s should be replaced.
Basically apply the follwoing regular expression:
:%s/://g
to that particular text... (2 Replies)
I've found this script which seems very promising to solve my issue:
To search and replace many different database passwords in many different (.php, .pl, .cgi, etc.) files across my filesystem.
The passwords may or may not be contained within quotes, single quotes, etc.
#!/bin/bash... (4 Replies)
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)