HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Getting rid of empty file-names?
Operating System - HP-UX
1833538
Members
2974
Online
110061
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2001 11:49 PM
09-24-2001 11:49 PM
Hi.
I`ve made a script that automatically creates files depending on anothers files substance. (or...i didnt made it...i had help from this forum...=))..
The question is...Some of the files that are created get blank file names (one space and 2 spaces)....How can i get rid of them?
cd /Symbols/
(one blank Space) (2 spaces) benelli triumph
I have tried following...
if [ "`cat $file`" == *[a-z,0-9] ]
then echo `cat $comp` >> Symbols/`cat $file`
else :
fi
This will create on of the files "benelli"...but triumph, and the 2 with blank filenames will dissapear...But if i invert it..( != )...the other files will be shown....
why doesnt "triumph" pass when "benelli" does it?
b.r
Petter
I`ve made a script that automatically creates files depending on anothers files substance. (or...i didnt made it...i had help from this forum...=))..
The question is...Some of the files that are created get blank file names (one space and 2 spaces)....How can i get rid of them?
cd /Symbols/
(one blank Space) (2 spaces) benelli triumph
I have tried following...
if [ "`cat $file`" == *[a-z,0-9] ]
then echo `cat $comp` >> Symbols/`cat $file`
else :
fi
This will create on of the files "benelli"...but triumph, and the 2 with blank filenames will dissapear...But if i invert it..( != )...the other files will be shown....
why doesnt "triumph" pass when "benelli" does it?
b.r
Petter
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2001 11:58 PM
09-24-2001 11:58 PM
Solution
Hi Petter,
You can either enclose the filename in quotes or run in interactive mode:
ls -lo
total 6
-rw-r----- 1 root 4 Sep 25 08:57
-rw-r----- 1 root 6 Sep 25 08:55 abc
-rw-r----- 1 root 7 Sep 25 08:55 def
rm ' '
rm ' abc'
or
rm -i *
When you create the files within your script, you should check for and remove the spaces.
Rgds, Robin
You can either enclose the filename in quotes or run in interactive mode:
ls -lo
total 6
-rw-r----- 1 root 4 Sep 25 08:57
-rw-r----- 1 root 6 Sep 25 08:55 abc
-rw-r----- 1 root 7 Sep 25 08:55 def
rm ' '
rm ' abc'
or
rm -i *
When you create the files within your script, you should check for and remove the spaces.
Rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2001 12:15 AM
09-25-2001 12:15 AM
Re: Getting rid of empty file-names?
simply escape the spaces
e.g.
$ rm filename\ with\ spaces
e.g.
$ rm filename\ with\ spaces
Madness, thy name is system administration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2001 12:16 AM
09-25-2001 12:16 AM
Re: Getting rid of empty file-names?
Hehe...It sure did it...Why did I have to try to make it more complicate than it really was?....thnxs m8..
"Every problem is easy as long as you know the answer"
"Every problem is easy as long as you know the answer"
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP