Solved

compiling programs

Posted on 1998-10-24
5
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

752 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