Sponsored Content
Top Forums Shell Programming and Scripting Sed, replace variables in file Post 302800993 by hanson44 on Wednesday 1st of May 2013 04:02:01 AM
Old 05-01-2013
Second output line supposed to be 789cc$cc
This User Gave Thanks to hanson44 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

variables use upper case? sed : output to the same file?

Hi, Q1: are the variables in shell script usually UPPER CASE? Q2: can sed output to the same file that it's using it? eg. cat sameFile | sed 's/here/there/g' > sameFile ? I expect the sed replace all "here" to "there" and change it in sameFile. i tried that one, the sameFile... (1 Reply)
Discussion started by: gusla
1 Replies

2. UNIX for Dummies Questions & Answers

Problems with sed and flat file variables

Hello All, It has been a loooooooooooong time since I had last used sed but decided to use it for a simple task I have . My goal is to use sed to read variables from a flat file then use those same variables in order to make some subsitutions. However what I am finding is that when the... (1 Reply)
Discussion started by: icalderus
1 Replies

3. Shell Programming and Scripting

Replace environment variables with sed

Hi, I need to write a sed that replaces the value of all environment variables that have PASS in the name with ***** . I have a log file who prints the value of all environment variables ,including those who hold passwords. In the name of these variables I found always the PASS string, ex:... (16 Replies)
Discussion started by: liorfe
16 Replies

4. Shell Programming and Scripting

using sed to replace a specific string on a specific line number using variables

using sed to replace a specific string on a specific line number using variables this is where i am at grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean grep -n Destination... (2 Replies)
Discussion started by: todd.cutting
2 Replies

5. Shell Programming and Scripting

How to use sed to replace the a string in the same file using sed?

How do i replace a string using sed into the same file without creating a intermediate file? (7 Replies)
Discussion started by: gomes1333
7 Replies

6. Shell Programming and Scripting

replace two character strings by two variables with sed command

Hello, I want to writte a script that replace two character strings by two variables with the command sed butmy solution doesn't work. I'm written this: sed "s/TTFactivevent/$TTFav/g && s/switchSLL/$SLL/g" templatefile. I want to replace TTFactivevent by the variable $TTFav, that is a... (4 Replies)
Discussion started by: POPO10
4 Replies

7. Shell Programming and Scripting

Read file and for each line replace two variables, add strings and save output in another file

Hi All, I have a file, let's call it "info.tmp" that contains data like this .. ABC123456 PCX333445 BCD789833 I need to read "info.tmp" and for each line add strings in a way that the final output is put /logs/ua/dummy.trigger 'AAA00001.FTP.XXX.BLA03A01.xxxxxx(+1)' where XXX... (5 Replies)
Discussion started by: Andy_ARG
5 Replies

8. UNIX for Dummies Questions & Answers

How to use sed to copy specific lines from a file using shell variables?

hello! I am trying to use sed to copy specific set of lines from a file for which the starting and ending line numbers of the lines to be copied are stored in shell variables. How can i copy those lines? if the input_file is something like this and if the following is the script a=2 b=4... (4 Replies)
Discussion started by: a_ba
4 Replies

9. Shell Programming and Scripting

environment variables in a sed script file

Hello Everyone I need to create a script file which must append some lines to a target text file, I'm using sed for windows, the script file look like this: { a\ STRINGTABLE DISCARDABLE\ BEGIN\ 5, 150 {a\ #define RC_SHELL, "%ID_SHELL%"\ #define RC_NAME, "%ID_NAME%"\ END } ... (1 Reply)
Discussion started by: edgarvm
1 Replies

10. Shell Programming and Scripting

awk search/replace specific field, using variables for regexp & subsitution then overwrite file

Hello, I'm trying the solve the following problem. I have a file which I intend to use as a csv called master.csv The columns are separated by commas. I want to change the text on a specific row in either column 3,4,5 or 6 from xxx to yyy depending upon if column 1 matches a specified pattern.... (3 Replies)
Discussion started by: cyphex
3 Replies
XFM_MAILCAP(5)								XFM							    XFM_MAILCAP(5)

NAME
xfm_mailcap - mailcap information for usage within xfm or xfmmailcap DESCRIPTION
To determine what command to use to open a file with a specific mime type, xfm(1) uses files in a format similar to the mailcap format. The extensions are special actions to open directories or files to load into the application window and to include other mailcap files, so that the default mailcap databases in ~/.mailcap, /etc/mailcap, /usr/share/etc/mailcap and /usr/local/etc/mailcap can be included. This man page describes which fields are used and the extensions. For general information of the syntax of these files read the man pages mailcap(5) and update-mime(8). While this files are supposed to be read by xfm(1), there also is the program xfmmailcap(1) to ease debugging. GENERAL FORMAT
There is one entry per line. Empty lines and lines starting with a hash (#) are ignored. Each line consists of parts separated by semi- colons (;). The first part is the mime part or the token include. The second part is the view option. This is followed by an arbitrary number of option names, followed by a value after a equal sign, if they have a value. INCLUDES
Lines with a mime-type include or !include are not treated as mailcap specifiers, but cause the filename described by the second argument to be read at this place. I recommend placing the following line at the end of every $HOME/.xfm/xfm_mailcap file: include; /etc/X11/xfm/mailcap OPTIONS USED BY XFM
test The value of this option (after unescaping) is executed using system(3). If it fails, the content of the line is not used for any- thing but increasing the amount of output. Some tests weather a DISPLAY environment variable are set are omitted and considered always true. nametemplate If this option has a value, the filename has to match it when a action is executed. Otherwise it is replaced by a symlink matching it. It has to contain exactly one unescaped occurrence of %s, which is used as wild card for any positive number of characters. edit This is the preferred action to open a file. Unless it is one of the special actions explained below, it has to contain exactly one unescaped occurance of %s, which is replaced by the filename to open, or the filename of a symlink to the file to open in the case the filename might be dangerous or does not match the nametemplate of this line. needsterminal If this option, which normally has no value, is there, the actions specified in this line are executed in an X terminal emulator. SPECIAL ACTIONS
If the action with the highest priority is one the special strings OPEN or LOAD, no shell is spawned and no command executed. Instead the current file window is changed to the selected directory (OPEN) or the file is supposed to be in the xfm(5) format and loaded into the application window(LOAD). FILES
$HOME/.xfm/xfm_mailcap Unless xfm(1) is told to look at a different place via X resource Xfm.mailcapFile, this is the first place xfm looks for a file with the describes format. xfmmailcap(1) always looks here first. /etc/X11/xfm/xfm_mailcap If the first file does not exists, xfm(1) (unless it gets told a different place via the X resource Xfm.systemwideMailcapFile) and xfmmailcap(1) look for this file. It is recommended that the file in the home directory includes this file to get the system wide defaults. SEE ALSO
xfm(1), xfmmailcap(1), mailcap(5), update-mime(8). xfm 20 April, 2006 XFM_MAILCAP(5)
All times are GMT -4. The time now is 11:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy