The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
parse a file for a special character melanie_pfefer Shell Programming and Scripting 9 10-10-2008 04:00 AM
special character on Filename.. help!!!urgent genzbeat HP-UX 1 01-18-2008 03:55 PM
Special character in my file Ryan2786 UNIX for Dummies Questions & Answers 3 07-06-2007 12:35 AM
delete a special character in file srivsn Shell Programming and Scripting 1 03-15-2006 06:45 AM
Mount a character special file MuellerUrs SUN Solaris 1 07-15-2005 01:36 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-08-2008
sqa777 sqa777 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 19
How to copy/move to a file with a special character as the 1st char in the filename?

I am trying to create files with special characters in its filenames for testing purposes. This is on a Linux RHEL4 but this should also be applicable on a Unix shell.

I am able to create files with special characters in the filenames...e.g.

cp -pv foo.gif \*special.gif
cp -pv foo.gif \ blank.space.start.gif

I cannot create this filename:

-special.filename.txt

The cp or mv command thinks that the '-' character specifies a flag.

I've tried the following commands:

cp -pv foo.bar \-special.txt (this results in a filename of '\-special.txt')
cp -pv foo.bar '-special.txt' (cp thinks '-special.txt' is an invalid option)
cp -pv foo.bar '\-special.txt' (the result is the same as \-special.txt)

This might be a simple question but does anyone know how to create a file, either by cp or mv, with a filename that has the dash '-' character as the first character in the filename?
 

Bookmarks

Tags
linux commands, shell script, shell scripting, sqa777, unix commands, unix scripting, unix scripting basics

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 07:59 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