LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-01-2007, 09:24 AM   #1
KumARan23
LQ Newbie
 
Registered: Nov 2007
Posts: 5

Rep: Reputation: 0
15.How would you create and then delete a file called "$SHELL"?


please some one help me in creating this kind of file
 
Old 11-01-2007, 09:37 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Not a good idea, but maybe you have a reason to do that (homework?). You may have a look at "escape character" in man bash or in your reference text.
 
Old 11-01-2007, 10:30 AM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Escape it.
 
Old 11-05-2007, 05:54 AM   #4
KumARan23
LQ Newbie
 
Registered: Nov 2007
Posts: 5

Original Poster
Rep: Reputation: 0
thank you

Quote:
Originally Posted by colucix View Post
Not a good idea, but maybe you have a reason to do that (homework?). You may have a look at "escape character" in man bash or in your reference text.
thank you for helping me
 
Old 11-05-2007, 06:10 PM   #5
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
launch gedit
save a file as $SHELL
open up nautilus/Konquerer
right click on file and press send to trash
 
Old 11-05-2007, 06:17 PM   #6
LlNUX
Member
 
Registered: Oct 2007
Location: Sydney, Australia
Distribution: Debian
Posts: 63

Rep: Reputation: 15
linux rm command

check rm command there is similar example: linux commands
 
Old 11-06-2007, 09:32 AM   #7
merijnv
LQ Newbie
 
Registered: May 2007
Location: The Netherlands
Distribution: ubuntu-desktop 8.10 and ubuntu-server 8.10
Posts: 21

Rep: Reputation: 15
or simply give the answer

On the commandline try:
% rm -- '$SHELL'

usually, the argument -- tells a program that after that, even if something happens to start with a -, it is not a program argument anymore, i.e.:

% rm -- -f
 
Old 11-06-2007, 09:35 AM   #8
merijnv
LQ Newbie
 
Registered: May 2007
Location: The Netherlands
Distribution: ubuntu-desktop 8.10 and ubuntu-server 8.10
Posts: 21

Rep: Reputation: 15
ow, and to create such a file:

% touch '$SHELL'
 
Old 11-06-2007, 09:42 AM   #9
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Code:
touch \$SHELL
rm \$SHELL
Usually at school they ask you to remove -file but this one is even more funny, I hope it's asked to be run as root
 
Old 11-11-2007, 09:02 AM   #10
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
Much more dangerous example:
Code:
touch -- '-f *'
rm -i -- '-f *'
The -i option on rm can save you from serious mistakes

However the -f option overrides the -i option!

Last edited by Disillusionist; 11-11-2007 at 09:30 AM.
 
  


Reply

Tags
command, linux, rm



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File called "*" in home directory. krnlg Linux - General 15 10-25-2007 03:30 AM
How to remove a file called: "-be" zepplin611 AIX 7 08-21-2004 03:37 PM
oops - made a file called "--dereference" - how do I delete it? BrianK Linux - General 2 06-21-2004 08:37 PM
How do you delete a file called "--tape-lengh=1"? I've tried everything... Huddlebum Linux - General 1 01-01-2004 10:11 PM
Writing shell script called "convert" bluewolf Programming 3 02-04-2003 10:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration