UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old February 20th, 2005, 11:49 PM
Basil_Fawlty Basil_Fawlty is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 16 Basil_Fawlty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 7 m 7 sec
Reputation Power: 0
Creating and deleting certain files

How would you create and then delete a file called "$SHELL"?

How would you create and then delete a file that begins with the symbol #?

How would you create and then delete a file that begins with the symbol -?

Reply With Quote
  #2  
Old February 21st, 2005, 12:28 AM
vgersh99 vgersh99 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 47 vgersh99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 Days 5 h 36 m 43 sec
Reputation Power: 4
Send a message via AIM to vgersh99 Send a message via MSN to vgersh99 Send a message via Yahoo to vgersh99
what's your personal take on all of that?

Reply With Quote
  #3  
Old February 21st, 2005, 12:33 AM
Basil_Fawlty Basil_Fawlty is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 16 Basil_Fawlty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 7 m 7 sec
Reputation Power: 0
Quote:
Originally Posted by vgersh99
what's your personal take on all of that?


I think I should use cat for creating and rm for removing but I'm not sure of the exact syntax for this.

Reply With Quote
  #4  
Old February 21st, 2005, 12:43 AM
vgersh99 vgersh99 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 47 vgersh99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 Days 5 h 36 m 43 sec
Reputation Power: 4
Send a message via AIM to vgersh99 Send a message via MSN to vgersh99 Send a message via Yahoo to vgersh99
Quote:
Originally Posted by Basil_Fawlty
I think I should use cat for creating and rm for removing but I'm not sure of the exact syntax for this.


'touch' for creating
'rm' for removing

'man touch' - for details on 'touch'
'man rm' - for details on 'rm'

'man ksh' - for details of 'ksh' shell [if that's what you're using]

Reply With Quote
  #5  
Old February 21st, 2005, 04:09 AM
zlutovsky zlutovsky is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Prague, Czech Rep.
Posts: 116 zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level)zlutovsky User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 22 h 34 sec
Reputation Power: 6
Quote:
Originally Posted by vgersh99
'touch' for creating
'rm' for removing

'man touch' - for details on 'touch'
'man rm' - for details on 'rm'

'man ksh' - for details of 'ksh' shell [if that's what you're using]



1.

> '$SHELL'
rm '$SHELL'

2.

> '#aaa'
rm '#aaa'

3.

> '-aaa'
rm - '-aaa'
or rm anything_not_existent '-aaa'

Regards

Reply With Quote
  #6  
Old February 21st, 2005, 11:32 AM
Basil_Fawlty Basil_Fawlty is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 16 Basil_Fawlty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 7 m 7 sec
Reputation Power: 0
Quote:
Originally Posted by zlutovsky
1.

> '$SHELL'
rm '$SHELL'

2.

> '#aaa'
rm '#aaa'

3.

> '-aaa'
rm - '-aaa'
or rm anything_not_existent '-aaa'

Regards


Wouldn't it be this for #3?

rm -- '-aaa'

Reply With Quote
  #7  
Old February 21st, 2005, 11:40 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,083 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 44 m 45 sec
Reputation Power: 9
Quote:
Originally Posted by Basil_Fawlty
Wouldn't it be this for #3?

rm -- '-aaa'

ys, but many *nix does not know the '--' option
this always work
rm ./-aaa
or sure the absolute name
note the single quotes are useless.
__________________
working on Solaris[5-9], preferred languages french and C.

Reply With Quote
  #8  
Old February 21st, 2005, 11:47 AM
Basil_Fawlty Basil_Fawlty is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 16 Basil_Fawlty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 7 m 7 sec
Reputation Power: 0
Quote:
Originally Posted by guggach
ys, but many *nix does not know the '--' option
this always work
rm ./-aaa
or sure the absolute name
note the single quotes are useless.


So in Unix just using > without cat is used to create files with no text right?

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Creating and deleting certain files


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway