Solved

compiling programs

Posted on 1998-10-24
5
207 Views
Last Modified: 2010-04-20
how can I compile/run script that look LIKE
echo "Blah Blah. "
mv /home/users/ciris /home/ciris
rm /home/users/ciris/file
echo "finished."
?
0
Comment
Question by:ciris
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:xterm
ID: 1638352
Compile it?   You don't need to compile anything - your
script is ready to go.  Just put the line "#!/bin/sh" at
the top of a new file, enter your 4 lines below that, and
save it.

Then "chmod u+x filename" and run it with "./filename"
(or you can type "sh filename")
0
 

Author Comment

by:ciris
ID: 1638353
if I name it blah, how can I get it to be executed (in that directory only) as blah, not ./blah?
0
 
LVL 19

Accepted Solution

by:
xterm earned 100 total points
ID: 1638354
Well, you could add "." to your path by doing:
export PATH=$PATH:.

.but it is recommended generally that you do not login
as root with "." in your path (although the risk of being
trojaned with that being the last item in your path is
minimal).

An example would be if a user put a file called "ls" in his
home directory that contained "rm /etc/passwd" - you get the
idea, I'm sure.
0
 

Author Comment

by:ciris
ID: 1638355
deleting the password file would delete the passwords, right? would this work with a shadowed password?
0
 
LVL 19

Expert Comment

by:xterm
ID: 1638356
No, you'd have to delete /etc/shadow too - that wasn't my
point.  My point was that horrible things can happen if an
unsuspecting admin had . in their path & they had some
malicious shell users.  
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question