Sponsored Content
Top Forums Shell Programming and Scripting Renaming File Names in a folder/Dir Post 302820153 by rajamadhavan on Wednesday 12th of June 2013 06:41:00 AM
Old 06-12-2013
try escaping the dot

Code:
 new=${i//\./_}

This User Gave Thanks to rajamadhavan For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Getting all file names in a folder.

Hi All, I need help to create a shell script that does following: - do ls -1 and let all file names in the current folder - do wc for each file and if wc > 0 then send a mail. I am new to unix and do not know how to get filename one by one in a loop, so that wc can be done. I have done rest... (5 Replies)
Discussion started by: adadevil
5 Replies

2. UNIX for Advanced & Expert Users

Recursively check the file/dir names

Hi, ' recgrep find . | xargs grep ' is used to scan the contents recursively. I have a different requirement. I need to scan just the names and check for a pattern and display with fullpath. Is that already available? Closest that I am trying is 'ls -R | grep pattern' Here I would get multiple... (1 Reply)
Discussion started by: eagercyber
1 Replies

3. Shell Programming and Scripting

Renaming file names in a shell script

I want to write a shell script that will rename all the file names to today's date attached to it.. so for example i have a file names like file1.sales.20081201.txt.c zbrs.salestxtn.20091101.txt.inn then it will rename both the files with todays date to it so the file names get changed... (1 Reply)
Discussion started by: rudoraj
1 Replies

4. UNIX for Dummies Questions & Answers

Copying dir (and sub dir) file names from ftp server to txt file in diff server

Hey all, i want to copy only the file names from an ftp server (directory and all sub directory) to a text file in another server (non ftp), i.e. i want to recursively move through directories and copy only the names to a text file. any help is appreciated...thank you in advance (1 Reply)
Discussion started by: deking
1 Replies

5. Shell Programming and Scripting

File renaming from list of names contained in another file

I have to rename a large number of files so that the name of each file corresponds to a code number that is given side by side in a list (textfile). The list contains in column A the filename of the actual files to be renamed and in column B the name (a client code, 9 digits) that has to be... (7 Replies)
Discussion started by: netfreighter
7 Replies

6. Shell Programming and Scripting

Renaming file names

I have 7 files with 7 different names coming into a specified folder on weekly basis, i need to pick a file one after another and load into oracle table using sql loader. I am using ksh to do this. So in the process if the file has error records and if sql loader fails to load into oracle tables,... (2 Replies)
Discussion started by: vpv0002
2 Replies

7. UNIX for Dummies Questions & Answers

Renaming files in one file from names in other

Hi Guys, I have a small problem of renaming multiple files. For example I have names of a set of files in one directory like K2_34625-34675 K7_988963-988983 K12_773882-7734102 and the other set corresponding to the same is U_P_321_9_3_11.ab1 U_P_322_9_3_11.ab1 U_P_323_9_3_11.ab1 Now... (23 Replies)
Discussion started by: pawannoel
23 Replies

8. Shell Programming and Scripting

Shell Scripts (Renaming file names with sequential numbers)

Hi there, Firstly, I have no experience with shell scripts so would really appreciate some help. I have the following shell script that is causing some problems: moveit() { && set -x if then DOUBLE_DELIVERY=$(grep... (6 Replies)
Discussion started by: thebeno
6 Replies

9. Shell Programming and Scripting

Checking Multiple File existance in a UNIX folder(Note: File names are all different)

HI Guys, I have some 8 files with different name and extensions. I need to check if they are present in a specific folder or not and also want that script to show me which all are not present. I can write if condition for each file but from a developer perspective , i feel that is not a good... (3 Replies)
Discussion started by: shankarpanda003
3 Replies

10. UNIX for Beginners Questions & Answers

Renaming the file names in a directory

Hi, I have about 60 files in a directory and need to rename those files. For example the file names are i_can_phone_yymmdd.txt (where yymmdd is the date. i.e 170420 etc) i_usa_phone_1_yymmdd.txt i_eng_phone_4_yymmdd.txt The new file names should be phone.txt phone_1.txt phone_4.txt I am... (4 Replies)
Discussion started by: naveed
4 Replies
Test::Folder(3pm)					User Contributed Perl Documentation					 Test::Folder(3pm)

NAME
Test::Folder - test folder attributes SYNOPSIS
use Test::More ...; use Test::Folder; DESCRIPTION
This modules provides a collection of test utilities for folder attributes. Use it in combination with Test::More in your test programs. FUNCTIONS
folder_exists_ok(FOLDERNAME [, TESTNAME] ) Ok if the folder exists, and not ok otherwise. folder_not_exists_ok(FOLDERNAME [, TESTNAME] ) Ok if the folder does not exist, and not ok otherwise. folder_empty_ok(FOLDERNAME [, TESTNAME] ) Ok if the folder is empty (contains no files or subfolders), and not ok otherwise. folder_not_empty_ok(FOLDERNAME [, TESTNAME] ) Ok if the folder is not empty (contains any files or subfolders), and not ok otherwise. folder_readable_ok(FOLDERNAME [, TESTNAME] ) Ok if the folder is readable, and not ok otherwise. folder_not_readable_ok(FOLDERNAME [, TESTNAME] ) Ok if the folder is not readable, and not ok otherwise. folder_writable_ok(FOLDERNAME [, TESTNAME] ) Ok if the folder is writable, and not ok otherwise. folder_not_writable_ok(FOLDERNAME [, TESTNAME] ) Ok if the folder is not writable, and not ok otherwise. folder_executable_ok(FOLDERNAME [, TESTNAME] ) Ok if the folder is executable, and not ok otherwise. folder_not_executable_ok(FOLDERNAME [, TESTNAME] ) Ok if the folder is not executable, and not ok otherwise. TO DO
There are probably some more folder attributes that can be tested. If you need them, please ask (or better yet, contribute code!). AUTHOR
Martin 'Kingpin' Thurn, "mthurn at cpan.org", <http://tinyurl.com/nn67z>. BUGS
Please report any bugs or feature requests to "bug-test-dir at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Dir>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT
You can find documentation for this module with the perldoc command. perldoc Test::Folder You can also look for information at: o RT: CPAN's request tracker <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Dir> o AnnoCPAN: Annotated CPAN documentation <http://annocpan.org/dist/Test-Dir> o CPAN Ratings <http://cpanratings.perl.org/d/Test-Dir> o Search CPAN <http://search.cpan.org/dist/Test-Dir> ACKNOWLEDGEMENTS
COPYRIGHT &; LICENSE Copyright (C) 2007-2008 Martin 'Kingpin' Thurn This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2011-02-20 Test::Folder(3pm)
All times are GMT -4. The time now is 04:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy