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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-01-2007, 09:24 AM
|
#1
|
LQ Newbie
Registered: Nov 2007
Posts: 5
Rep:
|
15.How would you create and then delete a file called "$SHELL"?
please some one help me in creating this kind of file
|
|
|
11-01-2007, 09:37 AM
|
#2
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
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.
|
|
|
11-01-2007, 10:30 AM
|
#3
|
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824
|
Escape it.
|
|
|
11-05-2007, 05:54 AM
|
#4
|
LQ Newbie
Registered: Nov 2007
Posts: 5
Original Poster
Rep:
|
thank you
Quote:
Originally Posted by colucix
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
|
|
|
11-05-2007, 06:10 PM
|
#5
|
Senior Member
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079
Rep:
|
launch gedit
save a file as $SHELL
open up nautilus/Konquerer
right click on file and press send to trash
|
|
|
11-05-2007, 06:17 PM
|
#6
|
Member
Registered: Oct 2007
Location: Sydney, Australia
Distribution: Debian
Posts: 63
Rep:
|
linux rm command
check rm command there is similar example: linux commands
|
|
|
11-06-2007, 09:32 AM
|
#7
|
LQ Newbie
Registered: May 2007
Location: The Netherlands
Distribution: ubuntu-desktop 8.10 and ubuntu-server 8.10
Posts: 21
Rep:
|
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
|
|
|
11-06-2007, 09:35 AM
|
#8
|
LQ Newbie
Registered: May 2007
Location: The Netherlands
Distribution: ubuntu-desktop 8.10 and ubuntu-server 8.10
Posts: 21
Rep:
|
ow, and to create such a file:
% touch '$SHELL'
|
|
|
11-06-2007, 09:42 AM
|
#9
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
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 
|
|
|
11-11-2007, 09:02 AM
|
#10
|
Senior Member
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 10:25 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|