Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Replacing duplicated extensions, like .rtf.rtf Post 302923940 by Corona688 on Wednesday 5th of November 2014 10:15:56 AM
Old 11-05-2014
Quote:
Originally Posted by OmarKN
Hi and good day,

[i have Mac OS 10.9.5 and bash]

In Terminal I tried
Code:
mv *.rtf.rtf *.rtf

to get rid of double rtf extensions ( which came about from some other process),
but this doesn't work.

I don't know why.
Remember two important things. First, that * does not get passed into programs, the shell handles that before mv even runs. Second, that mv works like
Code:
mv source [source, source, ...] destination

Imagine you have these three files in the folder:

file1.rtf file2.rtf.rtf file3.rtf

Your command will expand to:

mv (all files matching *.rtf.rtf) (all files matching *.rtf)

which would be:

mv file2.rtf.rtf file1.rtf file2.rtf.rtf file3.rtf

...and then, mv gets run, with those exact arguments.

If it actually did what you asked, it would destroy most of them, leaving only one survivor named 'file3.rtf'. Fortunately it will refuse to rename multiple files, only move them.
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

converting PDF to text, rtf doc format

Hi all Is there any program which can convert PDF to word processor file ? If the PDF has smart quotes, bullet icons, copyright and trademark symbols, etc. what happens to them intext format? So ideally would like to conver into rtf or doc. Thanks SS (1 Reply)
Discussion started by: saurya_s
1 Replies

2. Windows & DOS: Issues & Discussions

RTF files can they be converted once they are on linux system

:D mount -t vfat /dev/hda1 /mnt my dillemma is simple i have psion 5 mx wich is an epoc type machine not only does it only work on windows as far as I know but I have to convert the files (the usual stuff!) sometimes a humen error happens and the files that I want to transfer to the linux drive... (7 Replies)
Discussion started by: moxxx68
7 Replies

3. Shell Programming and Scripting

embedded exe file into rtf file

Hi All I want a method in shell script which will embed the exe file into rtf file si that the rtf file can be open in word and so my exe. Actually what is happening in my system at present : The report in my system is a self-extracting Zip file with filetype '.EXE'. Double clicking... (1 Reply)
Discussion started by: rawatds
1 Replies

4. UNIX for Advanced & Expert Users

Can root ID be duplicated

Hi, I have the root id and the uid is always 0 for the root. Can i create another user say admin with the uid as 0? If so will it have the same privilege as that of user. Will there be any effect while doing this? lorcan (6 Replies)
Discussion started by: lorcan
6 Replies

5. UNIX for Dummies Questions & Answers

Problem to send rtf inline body

how send an rtf file as inline body of email (not as an attachment) sendmail/mailx < test.rtf is not working (7 Replies)
Discussion started by: srik_ux
7 Replies

6. UNIX and Linux Applications

looking for convert rtf to pdf utility

Hello all i have server that needs to add the ability to convert rtf files to pdf what you recommend me to use ( not open office please ) its spouse to process lots of files . something i can wrap in code and use (2 Replies)
Discussion started by: umen
2 Replies

7. Shell Programming and Scripting

how to convert XLS to CSV and DOC/RTF to TXT

Hi, i don't know anything about PERL. Can anyone help me providing PERL scripts for 1. converting XLS to CSV (and vice-versa) 2. converting DOC/RTF to TXT Thanks much Prvn (1 Reply)
Discussion started by: prvnrk
1 Replies

8. Shell Programming and Scripting

Replacing multiple extensions

HI, I have some csv files with mutiple extensions, I want to remove all the extensions and keep only the .csv extension. anybody can suggest me how to do this. source files 1.txt.csv.txt.csv.csv.txt.csv 2.csv.txt.csv.txt.csv.txt target 1.csv 2.csv --Wang (1 Reply)
Discussion started by: wangkc
1 Replies

9. UNIX for Dummies Questions & Answers

Duplicated UID

Hi folks! I need you help to discover what's the impact of a duplicated UID in an operating system. What's the meaning when someone put in different users the same UID? (3 Replies)
Discussion started by: phcostabh
3 Replies

10. Programming

RTFEditorKit - Write to RTF File

Hi, I am looking at writing the BLOB from database which is an rtf data to write to RTF file. I am trying to use the RTFEditorKit for the same and was struck with the write API it provides. write API takes the outstream and Document, all I have is Inputstream or bytestream from database -... (5 Replies)
Discussion started by: vijaykrc
5 Replies
TEXTUTIL(1)						    BSD General Commands Manual 					       TEXTUTIL(1)

NAME
textutil -- text utility SYNOPSIS
textutil [command_option] [other_options] file ... DESCRIPTION
textutil can be used to manipulate text files of various formats, using the mechanisms provided by the Cocoa text system. The first argument indicates the operation to perform, one of: -help Show the usage information for the command and exit. This is the default command option if none is specified. -info Display information about the specified files. -convert fmt Convert the specified files to the indicated format and write each one back to the file system. -cat fmt Read the specified files, concatenate them, and write the result out as a single file in the indicated format. fmt is one of: txt, html, rtf, rtfd, doc, docx, wordml, odt, or webarchive There are some additional options for general use: -extension ext Specify an extension to be used for output files (by default, the extension will be determined from the format). -output path Specify the file name to be used for the first output file. -stdin Specify that input should be read from stdin rather than from files. -stdout Specify that the first output file should go to stdout. -encoding IANA_name | NSStringEncoding Specify the encoding to be used for plain text or HTML output files (by default, the output encoding will be UTF-8). NSStringEncoding refers to one of the numeric values recognized by NSString. IANA_name refers to an IANA character set name as understood by CFString. The operation will fail if the file cannot be converted to the specified encoding. -inputencoding IANA_name | NSStringEncoding Force all plain text input files to be interpreted using the specified encoding (by default, a file's encoding will be deter- mined from its BOM). The operation will fail if the file cannot be interpreted using the specified encoding. -format fmt Force all input files to be interpreted using the indicated format (by default, a file's format will be determined from its contents). -font font Specify the name of the font to be used for converting plain to rich text. -fontsize size Specify the size in points of the font to be used for converting plain to rich text. -- Specify that all further arguments are file names. There are some additional options for HTML and WebArchive files: -noload Do not load subsidiary resources. -nostore Do not write out subsidiary resources. -baseurl url Specify a base URL to be used for relative URLs. -timeout t Specify the time in seconds to wait for resources to load. -textsizemultiplier x Specify a numeric factor by which to multiply font sizes. -excludedelements (tag1, tag2, ...) Specify which HTML elements should not be used in generated HTML (the list should be a single argument, and so will usually need to be quoted in a shell context). -prefixspaces n Specify the number of spaces by which to indent nested elements in generated HTML (default is 2). There are some additional options for treating metadata: -strip Do not copy metadata from input files to output files. -title val Specify the title metadata attribute for output files. -author val Specify the author metadata attribute for output files. -subject val Specify the subject metadata attribute for output files. -keywords (val1, val2, ...) Specify the keywords metadata attribute for output files (the list should be a single argument, and so will usually need to be quoted in a shell context). -comment val Specify the comment metadata attribute for output files. -editor val Specify the editor metadata attribute for output files. -company val Specify the company metadata attribute for output files. -creationtime yyyy-mm-ddThh:mm:ssZ Specify the creation time metadata attribute for output files. -modificationtime yyyy-mm-ddThh:mm:ssZ Specify the modification time metadata attribute for output files. EXAMPLES
textutil -info foo.rtf displays information about foo.rtf. textutil -convert html foo.rtf converts foo.rtf into foo.html. textutil -convert rtf -font Times -fontsize 10 foo.txt converts foo.txt into foo.rtf, using Times 10 for the font. textutil -cat html -title "Several Files" -output index.html *.rtf loads all RTF files in the current directory, concatenates their contents, and writes the result out as index.html with the HTML title set to "Several Files". DIAGNOSTICS
The textutil command exits 0 on success, and 1 on failure. CAUTIONS
Some options may require a connection to the window server. HISTORY
The textutil command first appeared in Mac OS X 10.4. macOS September 9, 2004 macOS
All times are GMT -4. The time now is 07:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy