05-28-2012
Thanks a lot guruprasadpr, for the swift reply.
But I forgot to mention 1 thing
![Frown Smilie](https://www.unix.com/images/smilies/frown.gif)
- Sorry for the inconvenience
I need the # to be removed from lines which matches another string.
Lets says:
a.txt contains :
ritu|abc
#unix|def
unix|ghi
& b.txt contains :
#ritu|123
unix|567
the script needs to take an input for the main string - which will be "ritu" or "unix" in this case
So if the user enters "unix", the script should find all lines that contain "unix" in both the files & remove the "#" from it
So a.txt should now be :
ritu|abc
unix|def
unix|ghi
& b.txt should now be :
#ritu|123
unix|567
Could you please help on this
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi ,
I need to remove the 5th character of column1 and print the rest.
Can anybody give some advice?
Input:
0001c xx
0001r gg jj
0002y vv
0002p kk
0003q gg ll
0003v tt
0003t gg pp kk
Output:
0001 xx
0001 gg jj (9 Replies)
Discussion started by: Raynon
9 Replies
2. Shell Programming and Scripting
Hi I need to write a shell script which basically searches for all the empty files within the directory structure, lists them before asking the user to confirm if they would like to delete them. If the user deletes the file then a notice would appear confirming the file is deleted.
I've be... (5 Replies)
Discussion started by: cat123
5 Replies
3. Shell Programming and Scripting
I have a text file with a few thousand lines in the format:
abcdef*ghijk*lmno
pqrs*tuv
wx*y*z
etc.
What I want to do is, get rid of everything after the SECOND asterik (the *) in each line (including the asterik). So for the example above, it would look like this after the editing:
... (11 Replies)
Discussion started by: guitarscn
11 Replies
4. Shell Programming and Scripting
Hi
I am Trying to Write a script that can goto 4 different directorys on the server & remove the Files older then 30 days ??
/logs
logs1 logs2 logs3
Now I need to remove files under
logs1 logs2 logs3 which are older then 30 days whose name stat 'sit' , 'mig','bld' .
in... (3 Replies)
Discussion started by: Beginner123
3 Replies
5. Shell Programming and Scripting
Hello,
I just saw that on my vps (centOS) my oscommerce with a seo script
has created millions of tmp files inside the /html/cache/ directory.
I would need to remove all those files (millions), I tried via shell but the vps
loads goes to very high and it hangs, is there some way to do a... (7 Replies)
Discussion started by: andymc1
7 Replies
6. Programming
Hi Team,
I have thousands of TIF files which are converted from PDF. Below is a sample of it.
LH9406_BLANCARAMOS_2012041812103210320001.tif
LH9406_BLANCARAMOS_2012041812103210320002.tif
LH9406_BLANCARAMOS_2012041812103210320003.tif
LH9411_ANGENIAHUTCHINSON_2012041812102510250001.tif... (9 Replies)
Discussion started by: paragnehete
9 Replies
7. UNIX for Dummies Questions & Answers
Hi Folks,
There is a job which generates a .zip files every day at /usr/app/generated directory , now please advise for the script that will delete this zip files permanently.but while deleting it should make sure that it will not delete the last two days recently generated zip files and this... (1 Reply)
Discussion started by: punpun66
1 Replies
8. UNIX for Dummies Questions & Answers
Hi Guys,
I want to search for a specific file in a directory which have a "b" letter as the 3rd character in the name of the file.
For Example :
/abc/efg/ldbjfblkj.sh
/abc/efg/erublkd.sh
/abc/efg/eibueora.sh
/abc/efg/kfvnmnb.sh
Since we have 2 files with "b" as a 3rd character in... (5 Replies)
Discussion started by: Pramod_009
5 Replies
9. Shell Programming and Scripting
Hi
My directory structure is as below.
dir1, dir2, dir3
I have the list of files to be deleted in the below path as below.
/staging/retain_for_2years/Cleanup/log $ ls -lrt
total 0
drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2
drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies
10. Shell Programming and Scripting
Hi,
I want a simple line of code that will compress files within a directory specified (parameter) and its subdirectories and also i want to remove files which are exactly 365 days old from the sysdate after this compression.
Please help.
Thanks,
JD (8 Replies)
Discussion started by: Jesshelle David
8 Replies
LEARN ABOUT DEBIAN
dh_installzope
DH_INSTALLZOPE(1) Debhelper DH_INSTALLZOPE(1)
NAME
dh_installzope - install zope product and extension files into package build directories
SYNOPSIS
dh_installzope [debhelper options] [-n] [-Xitem] [dir ...]
DESCRIPTION
dh_installzope is a debhelper program that is responsible for installing zope products and extensions into package build directories.
Directory names are interpreted as zope product names and will be installed into the first package dh_installzope is told to act on. By
default, this is the first binary package in debian/control, but if you use -p, -i, or -a flags, it will be the first package specified by
those flags.
dh_installzope automatically installs debian/dzproduct and debian/dzextension if it exists. If dh_installzope is acting on multiple
packages, debian/dzproduct and debian/dzextension files will be installed into the first package. Use debian/package.dzproduct and
debian/package.dzextension for different binary packages.
If your package needs to register more than one product or extension, you need multiple files. To accomplish this, you can use files named
debian/package.dzproduct.* and debian/package.dzextension.*
Missing dzproduct and dzextension files for the first package dh_installzope is told to act on are generated and installed automatically.
The substitution variable zope:Depends is replaced by a list of the available zope versions.
OPTIONS
-n, --noscripts
Do not modify postinst/prerm scripts.
-Xitem, --exclude=item
Exclude files that contain "item" anywhere in their filename from being installed.
directory ...
Install these directories as products into the first package acted on.
EXAMPLES
This is an example of a debian/package.dzproduct file:
Package: zope-cmfdefault1.4
Name: CMFDefault
Directory: CMFDefault:1.4
Depends: CMFTopic:1.4
Version: 1.4.7-1
ZopeVersions: 2.9 2.8
The Version field is added or updated by dh_installzope. If Name and Directory match, the latter can be omitted. A deviating Directory is
used to install different product versions. A Directory has the form <product name>[:<suffix>].
It is possible to specify the list of zope versions for the 2.x serie using a >= relation, like in this example:
Package: zope-psycopgda
ZopeVersions: >= 2.7
This allows bin-NMUs of zope products on new Zope 2.x major versions, and for this reason it should be the preferred syntax.
NOTES
Note that this command is not idempotent. "dh_clean -k" should be called between invocations of this command. Otherwise, it may cause
multiple instances of the same text to be added to maintainer scripts.
SEE ALSO
debhelper(7)
This program is a part of zope-debhelper.
AUTHOR
Matthias Klose <doko@ubuntu.com> Fabio Tranchitella <kobold@debian.org>
0.3.15 2011-06-21 DH_INSTALLZOPE(1)