Sponsored Content
Full Discussion: sed help,,kind of urgent!!
Special Forums UNIX and Linux Applications Infrastructure Monitoring sed help,,kind of urgent!! Post 302296087 by solaix14 on Tuesday 10th of March 2009 10:20:38 AM
Old 03-10-2009
sed help,,kind of urgent!!

Hello All,
My problem is:
I want to replace a line from a file with sed. The first word in that line is always the same in every server. The second line is server model, which of course will vary from platform to platform and I need to leave that word as it is. After the second word, I need to add two words at the end of that line.
example:
serverName Sun-Fire 200 (this is by default)
lets say if the server model is V480, then my output should be:
serverName V480 (test server) (commentSmilie

thanks in advance guys!!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

urgent sed help

Hi folks. I've tried to research this, but haven't found a good answer (could be my harried state). At any rate, I have records that end with two commas, a number, two commas this could be anywhere from ,,01,, to ,,09875953,, I need to remove the last two fields (the number... (3 Replies)
Discussion started by: kristy
3 Replies

2. Shell Programming and Scripting

Need urgent sed help

I am writing a shell script on SunOS cosuaah01 5.9 Generic_118558-11 sun4u sparc SUNW,Sun-Fire-V440 machine. The shell script in.sh looks like this: install_top=`pwd` fl2=/d01/applptch/ptchora/iAS/Apache/Apache/cgi-bin/cxtool/display_report.pl echo $fl2 mv $fl2 $fl2.old sed 5c\... (6 Replies)
Discussion started by: bhatia333
6 Replies

3. Shell Programming and Scripting

sed script help urgent

Collegues I am dealing with raw text files which is extracted from web pages. I have to find sentances which contains more than 99 words and have to put a "." after the 99th or 98 th word . Is there any possiblity to it in sed or awk With regards Jaganadh.H (5 Replies)
Discussion started by: jaganadh
5 Replies

4. Shell Programming and Scripting

Urgent Help With Sed

Hello, I need to use sed to replace a word in file. My command is this: sed "s/word_to_replace/'"${INPUT}"'/1 filename and because INPUT="~@#$%^&*()-_=+{}\|;:<>,./?" and / is also the delimiter so I'm keep on getting error message sed: command garbled: ... any suggestions about how I... (10 Replies)
Discussion started by: katrvu
10 Replies

5. Shell Programming and Scripting

Need Help using sed command(very urgent)

Hi all, Actually i want to delete the .ps extension from package1.ps string by using sed. Can any body tell me that how shell i do it????????? It is very urgent. Can anybody help me. I am trying to do this in the following way. ps_file="package1.ps" echo $ps_file sed s/.ps//g $ps_file... (9 Replies)
Discussion started by: sunitachoudhury
9 Replies

6. Shell Programming and Scripting

Urgent solution for simple sed

Hi Im running this command on AIX in ksh. My input file samp1 contains 1 2 123 12345 When I execute the following sed i dont get a matching pattern sed -n '/{1}/p' samp1 Can anyone help me with this simple thing (3 Replies)
Discussion started by: raghav288
3 Replies

7. Shell Programming and Scripting

awk or sed help urgent

Hello, I have a file with the follwoing pattern: Input file: =========== tcp://xxx:123 8179 YY 1798 YY tcp://abc:2345 not found tcp://swt:4945 7356 QQ tcp://pqr:456 8178 PP 9485 PP 4485 PP (8 Replies)
Discussion started by: uandme2k2
8 Replies

8. Shell Programming and Scripting

Urgent help req with grep + sed

HI all, i have a line in a file it cantains one;two_1_10;two_2_10;two_3_10;three~ now i need to get the output as one;two_1_abc_10;two_2_abc_10;two_3_abc_10;three~ ( 1 should be replaced with 1_abc for two__10 , and one more thing the number of occurances of two_value_10 will be... (1 Reply)
Discussion started by: 2001.arun
1 Replies

9. Shell Programming and Scripting

Need Urgent help on awk/sed

Hi, Sample Input Table 1 XXXXX YYYYY A 1 2 3 4 5 B 1 2 3 4 5 C 1 2 3 4 5 D 1 2 3 4 5 A 6 7 B 6 7 C 6 7 D 6 7 Table 2 XXXXX YYYYY E 1 2 3 4 5 F 1 2 3 4 5 E 6 7 F 6 7 Table 3 XXXXX YYYYY G 1 2 3 4 5 (4 Replies)
Discussion started by: ravin
4 Replies

10. Shell Programming and Scripting

sed command error-URGENT

sort.sh ------ ls -lSr|cat -n/*gives the detailed description o files with a serial number concatenated*/ i=0 n=10 j=$n if then while do (sh -C sub.sh $i $j)& ((i++)) ((j--)) done fi if then while do (sh -C sub.sh $i $j)& (1 Reply)
Discussion started by: dishak
1 Replies
pop3d(n)						      Tcl POP3 Server Package							  pop3d(n)

NAME
pop3d - Tcl POP3 server implementation SYNOPSIS
package require Tcl 8.2 package require pop3d ?1.0? ::pop3d::new ?serverName? serverName option ?arg arg ...? serverName up serverName down serverName destroy ?mode? serverName configure serverName configure -option serverName configure -option value... serverName cget -option serverName conn list serverName conn state id authCmd lookup name storageCmd dele mbox msgList storageCmd lock mbox storageCmd unlock mbox storageCmd size mbox msgId storageCmd stat mbox storageCmd get mbox msgId DESCRIPTION
::pop3d::new ?serverName? This command creates a new server object with an associated global Tcl command whose name is serverName. The command serverName may be used to invoke various operations on the server. It has the following general form: serverName option ?arg arg ...? Option and the args determine the exact behavior of the command. A pop3 server can be started on any port the caller has permission for from the operating system. The default port will be 110, which is the port defined by the standard (RFC 1939). After creating, configuring and starting a the server object will listen for and accept con- nections on that port and handle them according to the POP3 protocol. Note: The server provided by this module will handle only the basic protocol by itself. For the higher levels of user authentication and handling of the actual mailbox contents callbacks will be invoked. The following commands are possible for server objects: serverName up After this call the server will listen for connections on its configured port. serverName down After this call the server will stop listening for connections. This does not affect existing connections. serverName destroy ?mode? Destroys the server object. Currently open connections are handled depending on the chosen mode. The provided modes are: kill Destroys the server immediately, and forcefully closes all currently open connections. This is the default mode. defer Stops the server from accepting new connections and will actually destroy it only after the last of the currently open con- nections for the server is closed. serverName configure Returns a list containing all options and their current values in a format suitable for use by the command array set. The options themselves are described in section OPTIONS. serverName configure -option Returns the current value of the specified option. This is an alias for the method cget. The options themselves are described in section OPTIONS. serverName configure -option value... Sets the specified option to the provided value. The options themselves are described in section OPTIONS. serverName cget -option Returns the current value of the specified option. The options themselves are described in section OPTIONS. serverName conn list Returns a list containing the ids of all connections currently open. serverName conn state id Returns a list suitable for [array set] containing the state of the connection referenced by id. OPTIONS
The following options are available to pop3 server objects. -port port Defines the port to listen on for new connections. Default is 110. This option is a bit special. If port is set to "0" the server, or rather the operating system, will select a free port on its own. When querying -port the id of this chosen port will be returned. Changing the port while the server is up will neither change the returned value, nor will it change on which port the server is lis- tening on. Only after resetting the server via a call to down followed by a call to up will the new port take effect. It is at that time that the value returned when querying -port will change too. -auth command Defines a command prefix to call whenever the authentication of a user is required. If no such command is specified the server will reject all users. The interface which has to be provided by the command prefix is described in section AUTHENTICATION. -storage command Defines a command prefix to call whenever the handling of mailbox contents is required. If no such command is specified the server will claim that all mailboxes are empty. The interface which has to be provided by the command prefix is described in section MAIL- BOXES. AUTHENTICATION
Here we describe the interface which has to be provided by the authentication callback so that pop3 servers following the interface of this module are able to use it. authCmd lookup name This method is given a username and has to return a two-element list containing the password for this user and a storage reference, in this order. The storage reference is passed unchanged to the storage callback, see sections OPTIONS and MAILBOXES for either the option defining it and or the interface to provide, respectively. MAILBOXES
Here we describe the interface which has to be provided by the storage callback so that pop3 servers following the interface of this module are able to use it. The mbox argument is the storage reference as returned by the lookup method of the authentication command, see section AUTHENTICATION. storageCmd dele mbox msgList] Deletes the messages whose numeric ids are contained in the msgList from the mailbox specified via mbox. storageCmd lock mbox This method locks the specified mailbox for use by a single connection to the server. This is necessary to prevent havoc if several connections to the same mailbox are open. The complementary method is unlock. The command will return true if the lock could be set successfully or false if not. storageCmd unlock mbox This is the complementary method to lock, it revokes the lock on the specified mailbox. storageCmd size mbox msgId Determines the size of the message specified through its id in msgId, in bytes, and returns this number. storageCmd stat mbox Determines the number of messages in the specified mailbox and returns this number. storageCmd get mbox msgId Returns a handle for the specified message. This handle is a mime token following the interface described in the documentation of package mime. The pop3 server will use the functionality of the mime token to send the mail to the requestor at the other end of a pop3 connection. KEYWORDS
pop3, internet, network, protocol, rfc1939 pop3d 1.0 pop3d(n)
All times are GMT -4. The time now is 06:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy