Rename /Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Rename /Script
# 1  
Old 08-19-2009
Rename /Script

Hi Guys,

Here I have a simple rename script ... works perfectly fine. When files are on local machine ... But it will not work with the files on the server ...

Server is mounted
Path to the file is correct
Permissions 777
I tried couple things .. and no luck that's why I'm here Smilie

Code
Code:
my $datestamp = strftime("_%m_%d",localtime) ; 
rename("/V/sh/test/test$datestamp.txt", "TW_v1_$datestamp.txt") || print "Don't have permission to rename."; 
 
print "Done"; 
 
exit;

# 2  
Old 08-19-2009
Is it mounted via Samba? NFS?
# 3  
Old 08-19-2009
no Samba .. Its between to macs ...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script for rename many files

Hello friends! I have a problem with my script. I'm a italian boy. Sorry for my english ehehehehehhe. I've many files .jpg and I would like rename they in this mode: I have not files with progressive number e I would like rename with progressive number. Example: DSC_0012.JPG DSC_0582.JPG... (7 Replies)
Discussion started by: vegetablu
7 Replies

2. Shell Programming and Scripting

How to write rename script?

I have files fd01.calc,fd02.calc,fd03.calc..I want to rename in fd01.picks,fd02.picks,fd03.picks How to do this? (4 Replies)
Discussion started by: mikibelavista
4 Replies

3. Shell Programming and Scripting

Need bash script to ping the servers and rename the output file each time the script is ran

HI, I have a file serverlist in that all host names are placed. i have written a small script #./testping #! /bin/bash for i in `cat serverlist` do ping $i >> output.txt done so now it creates a file output.txt till here fine.. now each time i run this script the output file... (4 Replies)
Discussion started by: madhudeva
4 Replies

4. UNIX for Dummies Questions & Answers

Script to rename directories

I am trying to create a script that will search for a directory named bob, and then rename that directory to peter. I do not want the directory path to change. so /folders/bob would become /folders/peter It seems to be renaming the bob folder to peter correctly, but the peter folder ends... (2 Replies)
Discussion started by: gumby456m
2 Replies

5. Shell Programming and Scripting

Rename files in the script

Hi All, I want to write a script to rename the file in to the incremental order for example Original file filename=/nfs/n1/file1.img filename=/nfs/n1/file1.img filename=/nfs/n1/file1.img filename=/nfs/n1/file1.img filename=/nfs/n1/file1.img I want output shpuld be... (4 Replies)
Discussion started by: mangeshpardhi
4 Replies

6. Shell Programming and Scripting

Script to rename files

I have the following directories in my home directory, my scripts dbmig es ms_done my-home I want my output to look like the following MyScripts DbmigEs MsDone MyHome Basically, I want to get rid of spaces,special characters and convert the first letter of each word to uppercase and... (1 Reply)
Discussion started by: ramky79
1 Replies

7. Shell Programming and Scripting

Script Rename files

Hello, I have this problem. In a directory I have 4 csv files with this format: PHOENIX_KM_INTERAZIONI_YYYYMMDD.csv PHOENIX_KM_TRIPLETTE_YYYYMMDD.csv NEWCAB_KM_INTERAZIONI_YYYYMMDD.csv NEWCAB_KM_INTERAZIONI_YYYY_MM_DD.csv YYYYMMDD: format CURRENT date I wont rename all files in... (4 Replies)
Discussion started by: manichino74
4 Replies

8. UNIX for Dummies Questions & Answers

Script to Rename Files

I wrote a simple script that converts my windows text files to unix, so that I can compare them to different unix files purposes of my project. win2unix file1.txt file1Win.txt win2unix file2.txt file2Win.txt etc Is there a way to simplify this to: <while .txt in... (5 Replies)
Discussion started by: idano530
5 Replies

9. Shell Programming and Scripting

Debuggin' my rename script

hey everyone. i was on unix writing a script to rename all my files. and i've been running into problems. i really think this script has potential but i dont know how to get it as to wheres there are no errors. heres basically the steps i used. if some can write the script using the steps i... (1 Reply)
Discussion started by: live2learn
1 Replies

10. Shell Programming and Scripting

please help - script to list and rename

Hi Friend, I have a small script to list all file FFAAAAABBBBB00001 and FFAAAAABBBBB00001.repaired (when I run another script, the orginal file will output another *.repaired file) in my unix directory, and reaname the output file FFAAAAABBBBB00001.repaired back to FFAAAABBBBB00001. However, it... (2 Replies)
Discussion started by: happyv
2 Replies
Login or Register to Ask a Question