Blank space in Filename

Blank space in Filename

Post by oaklande » Sat, 05 May 2001 00:30:08



What I am trying to do is find out how to pull up
all files (in a script) with blank spaces in their filenames.
Example of two filename with spaces in them are:
File One
File Two

I want to pull them up in an interactive simple script
such as:

  echo enter data
  read data
  ls $data

Here is how the script works with all filenames
except ones with spaces in them.
Example of two filenames with commas in the name:
at,tex
bt,tex

  Unix-> script
  enter data
  *,*
  at,tex  bt,tex
  Unix c shell->  

This pulls up all files with commas in their
name (at,tex and bt,tex), but if I try to pull
up all files with blank spaces in them (File One
and File Two) it wont work or I dont know the correct
input for blank space.

  Ex:
  Unix-> script
  enter data
  " "
  ": No such file or directory
  ": No such file or directory
  Unix->    

I tried to put " " for blank spaces but it did
not work.

Any suggestions????

--
Posted via CNET Help.com
http://www.help.com/

 
 
 

Blank space in Filename

Post by Bill Marcu » Sat, 05 May 2001 03:24:45



>  *,*
>  at,tex  bt,tex
>  Unix c shell->

>This pulls up all files with commas in their
>name (at,tex and bt,tex), but if I try to pull
>up all files with blank spaces in them (File One
>and File Two) it wont work or I dont know the correct
>input for blank space.

*\ *

 
 
 

Blank space in Filename

Post by oaklande » Sat, 05 May 2001 20:30:05




> >  *,*
> >  at,tex  bt,tex
> >  Unix c shell->

> >This pulls up all files with commas in their
> >name (at,tex and bt,tex), but if I try to pull
> >up all files with blank spaces in them (File One
> >and File Two) it wont work or I dont know the correct
> >input for blank space.

> *\ *

I tried the *\ * and it pulls up all the files in my directory.
Any other suggestions??

--
Posted via CNET Help.com
http://www.help.com/

 
 
 

Blank space in Filename

Post by Charles Dem » Sun, 06 May 2001 01:53:00




>What I am trying to do is find out how to pull up
>all files (in a script) with blank spaces in their filenames.
>Example of two filename with spaces in them are:
>File One
>File Two

>I want to pull them up in an interactive simple script
>such as:

>  echo enter data
>  read data
>  ls $data

Try quoting $data:

  echo enter data
  read data
  ls "$data"

I haven't tried this.

Chuck Demas

Quote:

>Here is how the script works with all filenames
>except ones with spaces in them.
>Example of two filenames with commas in the name:
>at,tex
>bt,tex

>  Unix-> script
>  enter data
>  *,*
>  at,tex  bt,tex
>  Unix c shell->  

>This pulls up all files with commas in their
>name (at,tex and bt,tex), but if I try to pull
>up all files with blank spaces in them (File One
>and File Two) it wont work or I dont know the correct
>input for blank space.

>  Ex:
>  Unix-> script
>  enter data
>  " "
>  ": No such file or directory
>  ": No such file or directory
>  Unix->    

>I tried to put " " for blank spaces but it did
>not work.

>Any suggestions????

>--
>Posted via CNET Help.com
>http://www.help.com/

--
  Eat Healthy    |   _ _   | Nothing would be done at all,

  Die Anyway     |    v    | That no one could find fault with it.

 
 
 

1. Using tar with filenames that have blank spaces

I need to create a tar file for each application by reading its files
from an inputlist with 100 to 500 items.  Under the Mac OS X system
gnutar (1.13) has this option but tar doesn't. The filenames have
blank spaces between them and look like this:

/Library/Application Support/Application
name/Color/Profiles/CIERGB.icc
(there are other sub-directories and files under "/Library/Application
Support/Application name/"

/Users/admin/Library/Preferences/com.apple.nsl.ui
(there are other sub-directories and files under
"/Users/admin/Library/"

and so on.

If I try reading the filename from the input list as:
/Library/Application Support/Application
name/Color/Profiles/CIERGB.icc
I get the error message that "No such file or directory"

If I try reading as:
"/Applications/Application name/Examples/Curve Fits/Enzyme
Kinetics/mmf.TXT"
I get the message 'Cannot add file ": No such file or directory'

and for "Applications/Application name/Examples/Curve Fits/Enzyme
Kinetics/mmf.TXT"
I get the message 'Cannot add file ": No such file or directory'

Any tips on how to address this problem? Thanks!

James

2. Purchasing a Solaris x86 system

3. Changing Filenames with Blank spaces.

4. RAID 5 Set Internal to an E450?

5. Change blank space in Filename

6. remote sound

7. filenames with blanks, newlines, punctuations, and escape characters.

8. connect SW to s pseudo UART device instead of real serial device

9. How to create filename with date and not have blanks

10. Problems with filenames with blanks in find + while read

11. Renaming(mv) filenames with blanks?

12. sed command to replace text with blank spaces

13. reading in blank spaces