Sponsored Content
Top Forums Shell Programming and Scripting sed not outputing variable into new file Post 302796443 by hanson44 on Friday 19th of April 2013 02:28:37 PM
Old 04-19-2013
Probably best to start a new thread to solve this other interesting problem. Include the input, expected output, and what you have tried, using code tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

outputing sed to a variable

Hello, My appologies for asking a very basic question but... In a shell, I enter: echo tit | sed -e s/tit/tat/g This returns: tat as expected. But when I enter: set test = `echo tit | sed -e s/tit/tat/g` echo $test This returns an empty line. Why is this so and how... (3 Replies)
Discussion started by: flewis
3 Replies

2. Shell Programming and Scripting

sed -i '7 c\$variable' file ....(?!@#$%^&*!)

I have tried everything I can think of to get sed to change line N of a file to the contents of a variable. I have Googled the Internet, and I find lots of people telling how to use variables with the "Substitute" command, but no one telling how to use variables with the "Change" command. I... (4 Replies)
Discussion started by: Mr.Lauren
4 Replies

3. Shell Programming and Scripting

Having sed to read lines of a file with the use of a variable..Possible?

This i will print the second line of a file sed -n '2p' test2 The use of a variable is impossible here. a=1 while ; do line=`sed -n '$a p' test2` # do some things here with the line variable a=`expr $a + 1` done But the uotput of sed command is 'p'..... What can i do to use a variable... (2 Replies)
Discussion started by: hakermania
2 Replies

4. Shell Programming and Scripting

using file-and-replace sed command with the use of a variable?

Ok, so, let's say I have the variable $GMAILID....How can I use it with sed command so to replace a string in a file? e.g.: sed -i 's/$GMAILID/test@gmail.com/' /home/$USER/Desktop/sendmail (4 Replies)
Discussion started by: hakermania
4 Replies

5. Red Hat

How to pass value of pwd as variable in SED to replace variable in a script file

Hi all, Hereby wish to have your advise for below: Main concept is I intend to get current directory of my script file. This script file will be copied to /etc/init.d. A string in this copy will be replaced with current directory value. Below is original script file: ... (6 Replies)
Discussion started by: cielle
6 Replies

6. Shell Programming and Scripting

How to replace a string with a variable in a file using sed?

I have a file having some text like: PATH_ABC=/user/myLocation I have to replace "/user/myLocation" with a session variable say, $REPLACE_PATH, where $REPLACE_PATH=/user/myReplaceLocation The following sed command is not working. It is writing PATH_ABC=$REPLACE_PATH in the file ... (2 Replies)
Discussion started by: SKhan
2 Replies

7. Shell Programming and Scripting

sed replacement in file when line is in a variable

Hi, I have a file where I want to replace the 15th field separated by comma, only on specific lines matching lots of different conditions. I have managed to read the file line by line, within the loop my line is held in a variable called $line I assume this will be using sed (maybe... (5 Replies)
Discussion started by: jpt123
5 Replies

8. Shell Programming and Scripting

sed and variable as target file

for file in `ls /tmp/*_sw_list`; do /usr/bin/sed -i '' '1,/^Software\ Update/d' $file done In my script, this doesn't work. I can copy-and-paste it, and it works. Enabling debugging shows it is resolving the file name correctly... it isn't an issue with special characters in the filename. ... (3 Replies)
Discussion started by: jnojr
3 Replies

9. Shell Programming and Scripting

Using echo, grep and wc and outputing to text file

My current line command is as follows: echo -n "text: " ; grep "blah text" ../dir1/filename | wc -l The output to the screen is as needed, but how do I print to a text file? (9 Replies)
Discussion started by: ncwxpanther
9 Replies

10. UNIX for Beginners Questions & Answers

Awk/sed to replace variable in file

Hi All I have one file with multiple lines in it, each line has static text and some variable enclosed in <<filename>> as well. e.g. as below 123, <<file1.txt>> this is my name, I stay at <<city.txt>> Thanks for visiting 348384y, this is my name <<fileabc.txt>>, I stay at near the mall of... (8 Replies)
Discussion started by: reldb
8 Replies
DNETNML(8)						      System Manager's Manual							DNETNML(8)

NAME
dnetnml - DECnet Network Management Listener SYNOPSIS
dnetnml [options] Options: [-dVh] DESCRIPTION
dnetnml is a daemon that serves incoming management requests from remote systems, usually NCP in the case of VMS and RSX. It is recommended that the daemon be run from dnetd by adding the following line to /etc/dnetd.conf: NML 19 N nobody dnetnml Currently it only serves a subset of information requests. These are (in NCP terms): SHOW KNOWN NODES SHOW ADJACENT NODES SHOW EXEC CHAR SHOW KNOWN OBJECTS SHOW KNOWN LINKS Note that for SHOW KNOWN OBJECTS to work, /etc/dnetd.conf needs to be readable by the daemon user (usually 'nobody') or it will return a Privilege Violation. There is no sensitive data in this file so it's quite OK to set the permissions to 0644. Though this is not the default. OPTIONS
-d Don't fork and run the background. Use this for debugging. -v Verbose. The more of these there are the more verbose dnetnml will be. Don't use more than one for normal operation because it will seriously impair performance. -h -? Displays help for using the command. -V Show the version of dnetnml. BUGS
Probably lots, particularly as some of the functions are undocumented and I've had to reverse-engineer them. SHOW KNOWN LINKS doesn't show quite the same information as VMS does. dnetnml relies on the information it can get from /proc/net/decnet so it can't show load PIDs or processes unfortunately. SEE ALSO
dnetd(8), dnetd.conf(5) DECnet utilities September 5 2008 DNETNML(8)
All times are GMT -4. The time now is 02:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy