Sponsored Content
Full Discussion: Substitution using SED
Top Forums Shell Programming and Scripting Substitution using SED Post 302256618 by joeyg on Monday 10th of November 2008 09:15:40 AM
Old 11-10-2008
Question How do you think you woudl approach this

Or better yet...
What have you tried to accomplish this?

Can you provide some example programming you have written and/or "rough" script commands to accomplish your task?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Substitution using sed

I know we can substitute a string using sed but how? For example: sed 's/(old variable)/(new variable)/ details.dat Am I suppose to put $old variable or whatever? Because I tried many times, it didnt work by putting $old variable. Am I suppose to enclose it with "" or ''? Please help (3 Replies)
Discussion started by: Ohji
3 Replies

2. UNIX for Dummies Questions & Answers

sed substitution

Hi, I have a set of files containing strings like I.TEST1_TEST2 or B.ESSA_ESSB for example. Does somebody know how to substitute these strings whith the same name and an extension "_V1" (ie. I.TEST1_TEST2_V1) using sed command or else ? (3 Replies)
Discussion started by: jo_aze
3 Replies

3. Shell Programming and Scripting

SED Substitution

Hi , I am stuck up in the below scenario:- I need to read a file name (eg A.txt) name frm another file (eg B.txt) and then I need to search for a particular expression in A.txt and substitute it with another expression. How can I use SED inside SHELL Scripting and command prompt as well to... (1 Reply)
Discussion started by: shubhranshu
1 Replies

4. Shell Programming and Scripting

SED Substitution

Hi guys, Can u please help me to replace (-) with (/) in a file containing no of records using "sed " command in unix. thanks in advance. subhendu (5 Replies)
Discussion started by: subhendu81
5 Replies

5. Shell Programming and Scripting

sed substitution

Hi I am trying to do a text insertion in a text file at a particular line number in a shell script. However its not working. sed '122i\ > for j in \`echo $MyList\` ; do perl -pi -e\'s#01\/01\/2009#01\/01\/2011#\' $j ; done' $HOME/MyScript.ksh The Actual line to be inserted at line 122... (5 Replies)
Discussion started by: som.nitk
5 Replies

6. UNIX for Dummies Questions & Answers

Help with sed substitution

I'm a noob to unix, and I have a line of data like the following: title=Boston|tcolor=green|desc=Large city in New England|url=www.boston.com Is there a way to change a field value with sed substitution? (i.e. change tcolor=green to tcolor=blue) I figured out: sed... (19 Replies)
Discussion started by: stabby
19 Replies

7. Shell Programming and Scripting

Substitution with sed

I have a file with some numbers having single quotes around them which I want to remove. i.e. '923930' -> 23930 If it can be done without using sed thats fine. I have tried with sed but can't think how to replace this pattern on only the numbers (13 Replies)
Discussion started by: user_invalid
13 Replies

8. Shell Programming and Scripting

sed substitution

Hello, I have two files. File1 is normal txt file and File2 contains list of line numbers. e.g. File2: 3 6 9 ..... I need to replace a character in File1 in lines (taken from File2). For that I am using a "for" loop: for i in $(cat File2) do sed "$i s/Y/N/" File1 done but my... (3 Replies)
Discussion started by: shekhar2010us
3 Replies

9. UNIX for Dummies Questions & Answers

sed substitution

How can you use sed with a line of code that reads: 67899:Bill:Williams:Maple Dr.:45908600 Let us say we want to replace Maple Dr. with Oak St. (1 Reply)
Discussion started by: yonkers062986
1 Replies

10. Shell Programming and Scripting

sed substitution

Hi everyone, I need very simple sed command to change a parameter in a text file. I have a line in this text which is like set xx 0.5 A program reads this file and does some algebraic calculations. So to make a parameter scan I need to change the value of xx. I thought I can do... (7 Replies)
Discussion started by: hayreter
7 Replies
THINK(1)						      General Commands Manual							  THINK(1)

NAME
think - you don't have to think, the computer can think for you SYNOPSIS
think [ -detach ] DESCRIPTION
Think simulates a thinking brain. This can be useful if someone is not wanting to think at invocation time or if someone is needing some thinking about something. It can also be helpful if someone's brain is not working correctly at invocation time. When invoked, think will go ahead and look at all of the commands and keystrokes that a user has made during the current login session. Think will then look at what files the user has. From this and what level the user is listed at in the file /usr/lib/think, think will figure out what the user was trying to do when think was invoked. DEVICES
The process that think uses to help a user is greatly aided if the user is wearing a brain interface bus (bib) device. A bib device is normally worn on the head, and if being used, then think will try to see what was going through the users head at the time of invocation. After think does this, it will send electric signals to the users brain, causing the user to type in whatever keystrokes are necessary to accomplish the task that he/she doesn't want to think about. OPTIONS
-detach also known as "Must mother do all of your thinking for you?"-mode. This options causes think to run in the background as a daemon that watches for users who look like they may need assistance. When a user is found to be exercising cluelessness, think will lock up their keyboard and will proceed to execute what seems to be the most likely sequence of commands that the user had intended to execute. This flag may only be used by the super-user. FILES
/dev/brain bib device special file. /usr/lib/think file to indicate various user abilities. The format of this file is a username on each line followed by some whitspace and then a number. The higher the number for a given user, the more likely think is to assume that that user knows what he/she is doing. Unfortunately, what think considers a large number will vary with usage. BUGS
If a user is using a bib device and actually lacks a brain of their own, then there is a high risk that think will take over their (non- existent) minds. This has the upshot that someone other than the user will have to stop the program. (Perhaps this is a feature.) It may illegal in some areas to force users to wear bib devices. AUTHOR
This man page was written by John Guthrie <guthrie@math.upenn.edu> with suggestions from Kevin Whyte <kwhyte@math.upenn.edu> for the alt.sysadmin.recovery man page collection. think version 1.0 April 5, 1996 THINK(1)
All times are GMT -4. The time now is 02:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy