You can also separate with a newline, and you can use two -e options for sed, and I think you want to insert \ characters
In sed the \ character (and the & character and the separator) need to be \escaped in the substitution string.
Within a "quoted string" a \ needs to be \escaped for the shell, so "\\\\" becomes "\\" when passed to sed.
You see that a newline is retained within a "string in quotes" or a 'string in ticks'.
You further see that $( ) embeds a complete shell code that can be multi-line of course.
Usually I prefer one argument in ticks for sed:
knowing that '\'' is the escape for a literal ' within a 'string in ticks'
Last edited by MadeInGermany; 11-06-2018 at 08:13 AM..
Reason: /g modifier missing in the last sample
This User Gave Thanks to MadeInGermany For This Post:
Hi,
Am supposed to use message queues to send and receive messages between the processes. when i was working on that i realised that the message qid and the message queue related data should be maintained in a shared memory so that it can be accessed by all the processes. Could anybody refer... (10 Replies)
I am trying to write a script that will help me put a file into excel with little manipulation. Below is a sample of the file im using.
Group1:*:gid1:user,user
Group2:*:gid2:user,user
Group3:*:gid3:user,user,user,user,user,user,user
Group4:*:gid4:user,user
I marked in red the part that is... (1 Reply)
Hello all, I have been asked to exercise my shell scripting and it has been 10 plus years since I used to do it so I can not remember hardly anything and ask for your help.
What I need to do is copy a line out of a file that can be 10 to 100 characters long, I then need to parse this line into... (3 Replies)
I have a file with data records separated by multiple equals signs, as below.
==========
RECORD 1
==========
RECORD 2
DATA LINE
==========
RECORD 3
==========
RECORD 4
DATA LINE
==========
RECORD 5
DATA LINE
==========
I need to filter out all data from this file where the... (2 Replies)
i have to remove the commented (/* . . . .*/) part which starts in one line and ends in other.help me with generic code because i have 1000 to 10k lines code which i have to remove.
data one;
set work.temp;
input name age;
infile filename;
/* dfsdf
dsfs
sdfdf
dsdd
sdfsf
sdfsf
sfs... (4 Replies)
It looks like if matching and deleting the last line confuses 'sed' so it does not recognize '$' address. Consider:
sed -e '/^3/d' -e '$ a text'
supposed to delete a line starting with '3' and then append 'text' after the last line of input. But, if it is the last line of input which starts... (2 Replies)
Hello,
Currently, I am reading few queries from the below .sql file
--SOURCE TABLE NAME
--SOURCE QUERY
SEL COL1, COL2, COL3, COL4,
COL5, COL6, COL7 WHERE COL5 = '2015-11-04 16:24:00.000000' FROM SOURCE TABLE;
--TARGET TABLE NAME
--TARGET QUERY
SEL COLUMN1, COLUMN2, COLUMN3, COLUMN4,... (4 Replies)
Hi there,
I'm trying to create a script that will accept multiple inputs by copying and pasting the strings from a notepad, hit Enter key and output the string to a text file.I'm thinking of using the read command however it will just simply get the first line.
Apologies but got no idea how... (7 Replies)
Hi,
Can anyone help me for merge the following multi-line log which beginning with a " and line ending with ": into one line.
*****Original Log*****
087;2008-12-06;084403;"mc;;SYHLR6AP1D\LNZW;AD-703;1;12475;SYHLR6AP1B;1.1.1.1;0000000062;HGPDI:MSISDN=12345678,APNID=1,EQOSID=365;... (3 Replies)
Discussion started by: rajeshlinux2010
3 Replies
LEARN ABOUT OSX
chatwidget
chatwidget(n) Composite widget for chat applications chatwidget(n)
__________________________________________________________________________________________________________________________________________________NAME
chatwidget - Provides a multi-paned view suitable for display of chat room or irc channel information
SYNOPSIS
package require Tk 8.5
package require chatwidget ?1.0.0?
::chatwidget::chatwidget path ?options?
$widget topic command args
$widget name nick args
$widget message text args
$widget hook command args
$widget names args
$widget entry args
$widget chat args
_________________________________________________________________DESCRIPTION
This is a composite widget designed to simplify the construction of chat applications. The widget contains display areas for chat messages,
user names and topic and an entry area. It automatically handles colourization of messages per nick and manages nick completion. A system
of hooks permit the application author to adjust display features. The main chat display area may be split for use displaying history or
for searching.
The widget is made up of a number of text widget and panedwindow widgets so that the size of each part of the display may be adjusted by
the user. All the text widgets may be accessed via widget passthrough commands if fine adjustment is required. The topic and names sections
can also be hidden if desired.
COMMANDS
::chatwidget::chatwidget path ?options?
Create a new chatwidget using the Tk window id path. Any options provided are currently passed directly to the main chat text wid-
get.
WIDGET COMMANDS
$widget topic command args
The chat widget can display a topic string, for instance the topic or name given to a multi-user chatroom or irc channel.
show Enable display of the topic.
hide Disable display of the topic
set topic
Set the topic text to topic.
$widget name nick args
Control the names and tags associated with names.
list ?-full?
Returns a list of all the user names from the names view. If ?-full? is given then the list returned is a list of lists where
each sublist is made up of the nick followed by any options that have been set on this nick entry. This may be used to exam-
ine any application specific options that may be applied to a nick when using the add command.
add nick ?options?
delete nick
$widget message text args
Add messages to the display. options are -nick, -time, -type, -mark -tags
$widget hook command args
Manage hooks. add (message, post names_group, names_nick, chatstate), remove, run
$widget names args
Passthrough to the name display text widget. See the text widget manual for all available commands. The chatwidget provides two
additional commands show and hide which are used to control the display of this element in the widget.
$widget entry args
Passthrough to the entry text widget. See the text widget manual for all available commands.
$widget chat args
Passthrough to the chat text widget. See the text widget manual for all available commands.
EXAMPLE
chatwidget::chatwidget .chat
proc speak {w msg} {$w message $msg -nick user}
pack .chat -side top -fill both -expand 1
A more extensive example is available by examining the code for the picoirc program in the tclapps repository which ties the tcllib picoirc
package to this chatwidget package to create a simple irc client.
SEE ALSO
text(n)
KEYWORDS
chat, chatwidget, composite widget, irc, mega-widget, widget
chatwidget 1.0.0 chatwidget(n)