Sponsored Content
Top Forums Shell Programming and Scripting find and replace in subdirectory (filename & content - both) Post 302208879 by Franklin52 on Wednesday 25th of June 2008 07:19:34 AM
Old 06-25-2008
Code:
awk '
/cust_mst.SRVC_PROVIDER/{sub("cust_mst","reseller_mst")}
{print}
' /D0/D1/D2/CUST_MST_TEMP.txt > /D0/D1/D2/RESELLER_MST_TEMP.txt

Regards
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find filename based on file content

:confused: There is a flat file on my system which contains email addreses of people in my company. This file is utilized when sending notifications for various things. However nobody knows where this file is located or what it is named. The only thing we know is the email address of a user who... (4 Replies)
Discussion started by: kollerj
4 Replies

2. Shell Programming and Scripting

Redirect grep output to dynamique fileName and subdirectory

Hi all i'm new in KSH, i want to write a script to grep a logs files and redirecting the result into a relative subdirectory/file.txt that must be created near to each log file my begin script is : find ./logs -type f -name "*.log" -exec grep error {} \; how i can perform that modest... (10 Replies)
Discussion started by: rambler
10 Replies

3. Shell Programming and Scripting

Find & Replace string in multiple files & folders using perl

find . -type f -name "*.sql" -print|xargs perl -i -pe 's/pattern/replaced/g' this is simple logic to find and replace in multiple files & folders Hope this helps. Thanks Zaheer (0 Replies)
Discussion started by: Zaheer.mic
0 Replies

4. Shell Programming and Scripting

Search & replace content using awk/gsub

Hi, I have two files master.txt & reference.txt. Sample below Master.txt 2372,MTS,AP 919848001104,Airtel,DL 0819,MTS,MUM 919849788001,Airtel,AP 1430,Aircel MP,20 Reference.txt 2372,919848701430,46467 919848002372,2372,47195 2372,919849788001,59027 0819,028803,1 0819,029801,1... (2 Replies)
Discussion started by: siramitsharma
2 Replies

5. Shell Programming and Scripting

Search & Replace content of files using gsub in awk

Hi,I have 2 files master.txt & reference.txt as shown below & i require o/p as mentioned in file 3 using awk but content is not replacing properlymaster.txt:... (15 Replies)
Discussion started by: siramitsharma
15 Replies

6. UNIX for Dummies Questions & Answers

How to find a file based on pattern & return the filename if found?

Hi all, I am a newbie here. I have this requirement to find a file based on a pattern then return the filename if found. I created a script based on online tutorials. Though, I am stuck & really appreciate if anyone can have a quick look & point me to the right direction? #Script starts... (10 Replies)
Discussion started by: buster_t
10 Replies

7. Shell Programming and Scripting

Find: filename in every subdirectory matching a pattern

Hi, I have multiple directories built in following manner /app/red/tmp /app/blue/upd /app/blue/tmp /app/green/tmp /app/red/upd /app/green/upd I have filenames having pattern ONE.XXX.dat TWO.ZZZ.dat and so on across the folders listed above My objective is to list all filenames of a... (4 Replies)
Discussion started by: wahi80
4 Replies

8. UNIX for Dummies Questions & Answers

List all File Content its subdirectory

Is there anyway to display the file content in a subdirectory that starts or ends with a certain filename, say .txt? or start with NTS $ ls * dos2unix.bat dos2unix.exe test.txt FilePermissions: filepermission.html NTSLA32_SystemDrive.txt NTSLA36_regedit.txt filepermission.sh ... (1 Reply)
Discussion started by: alvinoo
1 Replies

9. UNIX for Dummies Questions & Answers

Find all files containing string not following symlinks CAT (modified) output content to /filename

This should recursively walk through all dirictories and search for a specified string in all present files, if found output manicured content (eg some regex) with CAT into a specified directory (eg /tmp/) one by one, keeping the original names This is what I have so far, which seems to... (1 Reply)
Discussion started by: lowmaster
1 Replies

10. Shell Programming and Scripting

Compressing & removing files in a directory & subdirectory

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
dpkg-name(1)							  dpkg utilities						      dpkg-name(1)

NAME
dpkg-name - rename Debian packages to full package names SYNOPSIS
dpkg-name [options] [--] files DESCRIPTION
This manual page documents the dpkg-name program which provides an easy way to rename Debian packages into their full package names. A full package name consists of <package>_<version>_<architecture>.<package_type> as specified in the control file of the package. The <version> part of the filename consists of the upstream version information optionally followed by a hyphen and the revision information. The <pack- age_type> part comes from that field if present or fallbacks to deb. OPTIONS
-a, --no-architecture The destination filename will not have the architecture information. -k, --symlink Create a symlink, instead of moving. -o, --overwrite Existing files will be overwritten if they have the same name as the destination filename. -s, --subdir [dir] Files will be moved into a subdirectory. If the directory given as argument exists the files will be moved into that directory oth- erwise the name of the target directory is extracted from the section field in the control part of the package. The target directory will be `unstable/binary-<architecture>/<section>'. If the section is not found in the control, then `no-section' is assumed, and in this case, as well as for sections `non-free' and `contrib' the target directory is `<section>/binary-<architecture>'. The section field isn't required so a lot of packages will find their way to the `no-section' area. Use this option with care, it's messy. -c, --create-dir This option can used together with the -s option. If a target directory isn't found it will be created automatically. Use this option with care. -h, --help Show the usage message and exit. -v, --version Show the version and exit. EXAMPLES
dpkg-name bar-foo.deb The file `bar-foo.deb' will be renamed to bar-foo_1.0-2_i386.deb or something similar (depending on whatever information is in the control part of `bar-foo.deb'). find /root/debian/ -name '*.deb' | xargs -n 1 dpkg-name -a All files with the extension `deb' in the directory /root/debian and its subdirectory's will be renamed by dpkg-name if required into names with no architecture information. find -name '*.deb' | xargs -n 1 dpkg-name -a -o -s -c Don't do this. Your archive will be messed up completely because a lot of packages don't come with section information. Don't do this. dpkg --build debian-tmp && dpkg-name -o -s .. debian-tmp.deb This can be used when building new packages. BUGS
Some packages don't follow the name structure <package>_<version>_<architecture>.deb. Packages renamed by dpkg-name will follow this struc- ture. Generally this will have no impact on how packages are installed by dselect(1)/ dpkg(1), but other installation tools might depend on this naming structure. SEE ALSO
deb(5), deb-control(5), dpkg(1), dpkg-deb(1), find(1), xargs(1). AUTHOR
Copyright (C) 1995,1996 Erick Branderhorst This is free software; see the GNU General Public Licence version 2 or later for copying conditions. There is NO WARRANTY. Debian Project 2008-08-18 dpkg-name(1)
All times are GMT -4. The time now is 02:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy