sed -i destroy symlink - how to solve this ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sed -i destroy symlink - how to solve this ?
# 1  
Old 09-09-2009
sed -i destroy symlink - how to solve this ?

After a few hours of frustration because I didn't understand why my symlinks are destroyed i just found out that sed -i will destroy symlinks.
I searched but i didn't found any good solution for this.

Is there any way to overcome this ? On my ubuntu server sed version is 4.1.5

edit: Sorry for this topic, an obvious solution will be to update to sed 4.2 and user --follow-simlinks

Last edited by ktm; 09-09-2009 at 06:34 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to destroy corrupt zpool without importing it?

A couple of spare disks have been added to a Solaris 10 system, and one of them has a corrupt zpool on it. I don't care about the data: I want to destroy it and re-use the disk, but it's corrupt so I can't import it. The corrupt pool is called "rpool" so I don't want to destroy it by name... (2 Replies)
Discussion started by: Mysturji
2 Replies

2. What is on Your Mind?

How to destroy one's business...?

I don't know enough about this subject but this is for the big guns... Yesterday:- Man accidentally 'deletes his entire company' with one line of bad code | News | Lifestyle | The Independent (5 Replies)
Discussion started by: wisecracker
5 Replies

3. Shell Programming and Scripting

Search and Destroy Script Direction Help

Being a beginner in scripting I am not sure the direction to take to accomplish the below task and would love suggestions. GOAL input file: domains.list Read input file, search in named.conf and find domain and delete entry for the purpose of cleanup activity. named.conf entry example zone... (8 Replies)
Discussion started by: djzah
8 Replies

4. Hardware

Plop boot manager Destroy the pc

Hello friends , yesterday i used plop boot manager to shutdown the pc but after using it, nothing happened on screen , i mean cpu is running but monitor show blank screen and then i reassembled the whole pc again ,cleaned , reattach all the devices again but problem persist . Any help (0 Replies)
Discussion started by: rink
0 Replies

5. Solaris

ZFS - Dataset / pool name are the same...cannot destroy

I messed up my pool by doing zfs send...recive So I got the following : zpool list NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT rpool 928G 17.3G 911G 1% 1.00x ONLINE - tank1 928G 35.8G 892G 3% 1.00x ONLINE - So I have "tank1" pool. zfs get all... (8 Replies)
Discussion started by: eladgrs
8 Replies

6. Shell Programming and Scripting

ln -s creates symlink in symlink, if [ -f ... ] says file that exists doesn't exist

Hi Forums, I got a little problem, I made a few modifications to the code of the launch script of a testing server(minecraft) and now updating is broken aswell as the automatic directory creation. These Lines somehow create an endless symlink that refers to itself and I don't know how to fix... (0 Replies)
Discussion started by: Xaymar
0 Replies

7. Solaris

How to Destroy a processor set i.e pset

First of all I'm new to solaris. Today is the first day i'm practicing zones. In global zone i have created a two separate pools of 2CPU's and created a email-zone and a web-zone as given in a PDF. I deleted the 2 zones in the processor sets. How can i destroy the processor set and i want my... (2 Replies)
Discussion started by: breaker64
2 Replies

8. Shell Programming and Scripting

How to recursively search and destroy tabs

Inspite of my best efforts, eclipse 3.5 seems to continue to misbehave and insert tab characters in my source code. How do I write a script execute from emacs to search all my files for tab characters and conveniently position me on the line of code that has the offending tab? Here are my... (7 Replies)
Discussion started by: siegfried
7 Replies

9. Solaris

How to destroy hardware raid on T5120

Hi, I have problem creating hardware raid on T5120 with 4 disks. After the hardware raid 1 created, then I used the raidctl -l c1t0d0 and raidctl -l c1t2d0 the output of volume c1t0d0 contain disk 0.0.0 0.1.0, also the volume c1t2d0 contain disk 0.0.0 0.1.0 and should be 0.2.0 0.3.0 so I... (15 Replies)
Discussion started by: netlink
15 Replies

10. Debian

Don't want destroy windows! Ask skills

I am going to install Linux/Debian on my computer. My current OS is windows 98. My question is that if I install Linux, it is required to partition the hard drive. Windows may be destroyed. I still want to keep it. I have no windows installtion CD. I don't want to buy it. Can I avoid... (1 Reply)
Discussion started by: zhshqzyc
1 Replies
Login or Register to Ask a Question
DH_LINK(1)                                                           Debhelper                                                          DH_LINK(1)

NAME
dh_link - create symlinks in package build directories SYNOPSIS
dh_link [debhelperoptions] [-A] [-Xitem] [sourcedestination...] DESCRIPTION
dh_link is a debhelper program that creates symlinks in package build directories. dh_link accepts a list of pairs of source and destination files. The source files are the already existing files that will be symlinked from (called target by ln(1)). The destination files are the symlinks that will be created (called link name by ln(1)). There must be an equal number of source and destination files specified. Be sure you do specify the absolute path to both the source and destination files (unlike you would do if you were using something like ln(1)). Please note that the leading slash is optional. dh_link will generate symlinks that comply with Debian policy - absolute when policy says they should be absolute, and relative links with as short a path as possible. It will also create any subdirectories it needs to put the symlinks in. Any pre-existing destination files will be replaced with symlinks. dh_link also scans the package build tree for existing symlinks which do not conform to Debian policy, and corrects them (v4 or later). FILES
debian/package.links Lists pairs of source and destination files to be symlinked. Each pair should be put on its own line, with the source and destination separated by whitespace. In each pair the source file (called target by ln(1)) comes first and is followed by the destination file (called link name by ln(1)). Thus the pairs of source and destination files in each line are give in the same order as they would be given to ln(1). In contrast to ln(1), source and destination paths must be absolute (the leading slash is optional). OPTIONS
-A, --all Create any links specified by command line parameters in ALL packages acted on, not just the first. -Xitem, --exclude=item Exclude symlinks that contain item anywhere in their filename from being corrected to comply with Debian policy. source destination ... Create a file named destination as a link to a file named source. Do this in the package build directory of the first package acted on. (Or in all packages if -A is specified.) EXAMPLES
dh_link usr/share/man/man1/foo.1 usr/share/man/man1/bar.1 Make bar.1 be a symlink to foo.1 dh_link var/lib/foo usr/lib/foo usr/share/man/man1/foo.1 usr/share/man/man1/bar.1 Make /usr/lib/foo/ be a link to /var/lib/foo/, and bar.1 be a symlink to the foo.1 var/lib/foo usr/lib/foo usr/share/man/man1/foo.1 usr/share/man/man1/bar.1 Same as above but as content for a debian/package.links file. SEE ALSO
debhelper(7) This program is a part of debhelper. AUTHOR
Joey Hess <joeyh@debian.org> 11.1.6ubuntu2 2018-05-10 DH_LINK(1)