Sponsored Content
Top Forums Shell Programming and Scripting How to Rename/Convert Files in Shell Scripting? Post 302249310 by hanu_oracle on Tuesday 21st of October 2008 05:55:09 AM
Old 10-21-2008
Quote:
Originally Posted by palsevlohit_123
Try this...

Code:
for name in `ls -1 *.doc`
do
        mv $name ${name%.doc}.pdf
done

---------------------- Failed Output-------------------------
bash-2.05$ cat HelloPDF.sh

cd $HOME

for name in `ls -1 *.doc`
do
mv $name ${name%.doc}.pdf
done

bash-2.05$ sh HelloPDF.sh
HelloPDF.sh: bad substitution
------------------ Failed Output---------------------------
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

rename files using shell scripting

Hi all, i want to rename some files in my directory using korn shell scripting. 1) i want to rename files who have no extension so that they will have the format: filename.extension and 2) i want the files who has extension initially, to stay the same (they will not be... (4 Replies)
Discussion started by: gfhgfnhhn
4 Replies

2. Shell Programming and Scripting

Shell script to rename files with .1,.2,.3 ....ext respectively

Hey Guys.... Just need some help as I am not proficient in Unix shell script... Doubt: --------------- Suppose there will be some of the following files inside a directory called OUT ... Path: - /appdb1/product/batch/rms/OUT files inside OUT directory:- POSU_75002_20090127_20090129035442... (4 Replies)
Discussion started by: satyajit007
4 Replies

3. Shell Programming and Scripting

Shell Script to rename files

Hi, i need a bit of help writting a tcsh script which renames all ascii text files in the current directory by adding a number to their names before the extension so for example, a directory containing the files Hello.txt Hello.t Hello should have the following changes, Hello.txt... (2 Replies)
Discussion started by: yakuzaa
2 Replies

4. Shell Programming and Scripting

how to rename all files that have a certain text in the filename using tcsh shell

Hello~ I'm on AIX version 5 and I believe I have the tcsh shell environment to play in. Can you guys help me with a solution to rename all files that have "eclp" in the filename to "ecl" ? I basically want to rename the files and strip the "p" out. i.e. original filenames: ... (3 Replies)
Discussion started by: in2vtec
3 Replies

5. Shell Programming and Scripting

Need help for a Shell script to rename multiple files

Hi! I need help to create a shell script to search inside a file and then copy a portion of the search result as the new file name. Basically I was hacked over the weekend and the genius wipe out my drive from my server. I was able to recover alot of files, but biggest problem Is now the... (15 Replies)
Discussion started by: kidney514
15 Replies

6. Shell Programming and Scripting

Shell script to rename a group of files

Hello, I am having 1800 files in a directory with a specified format, like amms_850o_prod.000003uNy amms_850o_prod.000003u8x amms_850o_prod.000003taP amms_850o_prod.000003tKy amms_850o_prod.000003si4 amms_850o_prod.000003sTP amms_850o_prod.000003sBg amms_850o_prod.000003rvx... (12 Replies)
Discussion started by: atlantis
12 Replies

7. Shell Programming and Scripting

Windows Power Shell - rename files and move

hi people; i want to make a file/folder operation as follows. - i have 41 folders in Windows and each of them have same-named files (~200 files each) inside. - i want to stack these files together in a folder but Windows is asking to "overwrite" (as usual) since the file names are the same.... (2 Replies)
Discussion started by: gc_sw
2 Replies

8. Shell Programming and Scripting

How to convert string into integer in shell scripting?

Hi All, sessionid_remote=$(echo "select odb_sessionid from sysopendb where odb_dbname='syscdr';" | sudo -u cucluster ssh ucbu-aricent-vm93 "source /opt/cisco/connection/lib/connection.profile; $INFORMIXDIR/bin/dbaccess sysmaster@ciscounity") for sid in $sessionid_remote;do if * ]];... (2 Replies)
Discussion started by: deeptis
2 Replies

9. Shell Programming and Scripting

How to create or convert to pdf files from csv files using shell script?

Hi, Can anyone help me how to convert a .csv file to a .pdf file using shell script Thanks (2 Replies)
Discussion started by: ssk250
2 Replies

10. UNIX for Beginners Questions & Answers

Convert String to an Array using shell scripting in JSON file.

This is the sample json I have pasted here. I want all the IP address strings to be converted into an array. For example "10.38.32.202" has to be converted to everywhere in the JSON. There are multiple IPs in a JSON I am pasting one sample object from the JSON. But the IPs already in an Array... (11 Replies)
Discussion started by: vinshas1
11 Replies
Image::ExifTool::Exif(3pm)				User Contributed Perl Documentation				Image::ExifTool::Exif(3pm)

NAME
Image::ExifTool::Exif - Read EXIF/TIFF meta information SYNOPSIS
This module is required by Image::ExifTool. DESCRIPTION
This module contains routines required by Image::ExifTool for processing EXIF and TIFF meta information. AUTHOR
Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca) This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. REFERENCES
http://www.exif.org/Exif2-2.PDF <http://www.exif.org/Exif2-2.PDF> http://www.cipa.jp/english/hyoujunka/kikaku/pdf/DC-008-2010_E.pdf <http://www.cipa.jp/english/hyoujunka/kikaku/pdf/DC-008-2010_E.pdf> <http://partners.adobe.com/asn/developer/pdfs/tn/TIFF6.pdf> <http://partners.adobe.com/public/developer/en/tiff/TIFFPM6.pdf> <http://www.adobe.com/products/dng/pdfs/dng_spec.pdf> <http://www.awaresystems.be/imaging/tiff/tifftags.html> <http://www.remotesensing.org/libtiff/TIFFTechNote2.html> <http://www.exif.org/dcf.PDF> http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html <http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html> http://www.fine-view.com/jp/lab/doc/ps6ffspecsv2.pdf <http://www.fine-view.com/jp/lab/doc/ps6ffspecsv2.pdf> <http://www.ozhiker.com/electronics/pjmt/jpeg_info/meta.html> http://hul.harvard.edu/jhove/tiff-tags.html <http://hul.harvard.edu/jhove/tiff-tags.html> <http://www.microsoft.com/whdc/xps/wmphoto.mspx> <http://www.asmail.be/msg0054681802.html> <http://crousseau.free.fr/imgfmt_raw.htm> <http://www.cybercom.net/~dcoffin/dcraw/> <http://www.digitalpreservation.gov/formats/content/tiff_tags.shtml> <http://community.roxen.com/developers/idocs/rfc/rfc3949.html> http://tools.ietf.org/html/draft-ietf-fax-tiff-fx-extension1-01 <http://tools.ietf.org/html/draft-ietf-fax-tiff-fx-extension1-01> ACKNOWLEDGEMENTS
Thanks to Jeremy Brown for the 35efl tags, and Matt Madrid for his help with the XP character code conversions. SEE ALSO
"EXIF Tags" in Image::ExifTool::TagNames, Image::ExifTool(3pm) perl v5.12.4 2011-06-21 Image::ExifTool::Exif(3pm)
All times are GMT -4. The time now is 03:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy