Register
It is currently Wed Apr 23, 2014 9:11 am

BASH SCRIPT : An easy way to make a script executable


All times are UTC


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 PostPosted: Wed Jan 21, 2004 12:05 am   
Moderator
User avatar

Joined: Tue Dec 02, 2003 7:48 pm
Posts: 1723
Location: Georgia
i got sick of using chmod everytime i wrote a new script
so i wrote a script to do it for me :)
Code:
#!/bin/bash
# Author: Joshua Bailey
# Name: exe
# Syntax: exe path/filename
# Make a file executable for all
# Not safe for user sensitive files

# if there aren't any parameters when you execute the script
if [[ $# < 1 ]]
then
        echo "You must specify a file!"
else
        # if the parameter you specify exists
        if [[ ! -e $1 ]]
        then
                echo $1 "does not exist, or you didn't type the correct path."
        else
                chmod ugo+x $1
                echo $1 "is now executable."
        fi
fi

PM me for the xexe script (it removes the execute param for all users)


Last edited by jbsnake on Sat Aug 07, 2004 5:51 pm, edited 1 time in total.

Top
 Profile  
 PostPosted: Fri Feb 20, 2004 12:10 am   
Moderator
User avatar

Joined: Tue Dec 02, 2003 7:48 pm
Posts: 1723
Location: Georgia
this is a great script for people that make scripts on a regular basis...chmod is a pain :)


Top
 Profile  
 PostPosted: Fri Feb 20, 2004 1:01 am   
Keeper of the BIG STICK
User avatar

Joined: Wed Apr 30, 2003 7:16 pm
Posts: 12657
Location: Planet Earth
Nice. ;) Saves a little typing. With my fumble fingers, that's good. :D

_________________
Laptop: Mandriva 2010.1 PowerPack - 2.6.38.2-tmb-laptop-1mdv
Desktop: Mageia 1 - kernel 2.6.38.7-desktop-mga


Top
 Profile YIM  
 PostPosted: Fri Feb 20, 2004 5:50 am   
Advanced Member
User avatar

Joined: Fri Feb 13, 2004 7:57 pm
Posts: 571
Location: Austin
How am I gonna make this script executable! :cry:


Top
 Profile  
 PostPosted: Fri Feb 20, 2004 9:49 am   
Moderator
User avatar

Joined: Tue Dec 02, 2003 7:48 pm
Posts: 1723
Location: Georgia
:lol:


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Powered by phpBB © 2012 phpBB Group
© 2003 - 2012 USA LINUX USERS GROUP