The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
change file extension from root and subdirectories Astrid Shell Programming and Scripting 10 02-17-2008 07:18 AM
extension problem please help sharmasdeepti UNIX for Dummies Questions & Answers 1 10-24-2007 08:29 AM
without extension adurga UNIX for Dummies Questions & Answers 3 07-02-2007 01:34 PM
Changing extension mohan705 Shell Programming and Scripting 4 06-30-2007 02:06 PM
How to change extension? prkwan Shell Programming and Scripting 4 11-16-2002 07:14 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-28-2004
kswaraj kswaraj is offline
Registered User
  
 

Join Date: Jun 2004
Location: Brea CA
Posts: 24
how do i change extension

Hi

I am writing a script which does an FTP of a set of files onto another machine and then would have to rename the files into a different extension on the source machine.

for example if the file being sent via FTP is sample.txt. Once the file has been transferred i would want to modify the filename to look like sample.txt.sent.

I couldnt figure out how to do this.

i am trying with this command

mv $(file) $(file).sent

But this doesnt work but gives me a weird message
Usage: file [-c] [-m MagicFile] [-f ListFile] [File...]

I am using AIX 5.1 and bash shell.

Thanks in advance
  #2 (permalink)  
Old 06-28-2004
anarchie anarchie is offline
Registered User
  
 

Join Date: May 2004
Location: Hawaii
Posts: 37
The variable name delimiters are braces {} not parentheses ()

$(file) tries to execute the command named file, instead of inserting the variable named file.

You want mv ${file} ${file}.sent
  #3 (permalink)  
Old 06-28-2004
kswaraj kswaraj is offline
Registered User
  
 

Join Date: Jun 2004
Location: Brea CA
Posts: 24
hey Thanks a lot... it worked

Swaraj
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:44 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0