News Register Control Panel Private Messages Members List Team Search News Posts About Us

Linux Advisory » Q & A - Discussions » Programming & Coding » Bash Scripts » Hello Guest [login|register]
Last Post | First Unread Post Print Page | Recommend to Friend | Add Thread to Favorites
Post New Thread Post Reply
Author
Post « Previous Thread | Next Thread »
xception xception is a Male
Cool Newbie


Registration Date: 05-27-2003
Posts: 23
Location: Eire
Linux Distro: Mandrake

Rating:
2 Votes - Average Rating: 7.50

Level: 13 [?]
Experience Points: 3.449
Next Level: 4.033
584 point(s) of experience needed for next level

OFFLINE

Question Bash Scripts Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

Hi All

Im new to the world of linux and am trying my hand at some bash scripts. However, everytime i create a new file i also have to edit the permission of the file to be able to execute it.

I create the file either by typing "vi file.sh" or "touch file.sh". Is there another way i should be doing this?

thanxs all

P.S

Anyone know any good editors? I like using Multi Edit when using windows but have never found an editor as good for linux.



verum ipsum factum

05-29-2003 13:05 Send an Email to xception Search for Posts by xception Add xception to your Buddy List
Ravish Ravish is a Male
Administrator




Registration Date: 12-27-2002
Posts: 703
Location: Internet
Linux Distro: Redhat, Mandrake, Gentoo

Rating:
15 Votes - Average Rating: 8.13

Level: 29 [?]
Experience Points: 211.786
Next Level: 242.754
30.968 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

To be able to execute a file on a unix system, the file needs to have execute permission. Thats the one of the best features of unix. My favourite editor is vi though pico is also getting popular due to its ease of use.



05-29-2003 13:19 Send an Email to Ravish Homepage of Ravish Search for Posts by Ravish Add Ravish to your Buddy List AIM Screenname: Ravi5h YIM Screenname: ravishahuja1
xception xception is a Male
Cool Newbie


Registration Date: 05-27-2003
Posts: 23
Location: Eire
Linux Distro: Mandrake

Rating:
2 Votes - Average Rating: 7.50

Level: 13 [?]
Experience Points: 3.449
Next Level: 4.033
584 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

Is there some reason why files i create are not executable by default? When I create a file it only has user read and write permissions, and i have to do 'chmod 777 file.sh" to chage that.



verum ipsum factum

05-29-2003 13:37 Send an Email to xception Search for Posts by xception Add xception to your Buddy List
Ravish Ravish is a Male
Administrator




Registration Date: 12-27-2002
Posts: 703
Location: Internet
Linux Distro: Redhat, Mandrake, Gentoo

Rating:
15 Votes - Average Rating: 8.13

Level: 29 [?]
Experience Points: 211.786
Next Level: 242.754
30.968 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

You have to chmod it manually.



05-29-2003 16:05 Send an Email to Ravish Homepage of Ravish Search for Posts by Ravish Add Ravish to your Buddy List AIM Screenname: Ravi5h YIM Screenname: ravishahuja1
Heather Heather is a Female
Respected Member




Registration Date: 05-21-2003
Posts: 511
Location: Lost City of Zen.
Linux Distro: I'm OS neutral.

Rating:
9 Votes - Average Rating: 3.67

Level: 25 [?]
Experience Points: 79.541
Next Level: 100.000
20.459 point(s) of experience needed for next level

OFFLINE

Post Reply with Quote Edit/Delete Post Report Post to a Moderator       IP Information

I make my own scripts using CronJobs which are usually for backup. It's actually very simple to do. The script first creates full SQL backups of each database on site and places it in a folder "root/Backups" which can only be accessed by the owner of site. That way the casual surfer and/or hacker will never be able to access my backups. It then takes a full tarball backup of "public_html" folder. After that, it takes all of the SQL files just created plus the public_html folder and then makes it a single backup tarball. It is extremely fast and efficient. The average backup time is about 5 seconds. It's completely hands off and all I have to do is download a set of backups everyday. It will also FXP a copy of the backup to another server with a little extra work. This process happens every 12 hours and you've gotta love the email feature for cron jobs. Tongue

Why not program in the SSH Console? Tongue

As for your editor issue, try this: Blumentals HTMLPad 2002 Pro. This is my favorite editor because it is not only extremely robust, fast and efficient. It is also not cluttered in GUI like the others and extremely easy to use while being every bit as powerful...a winning combination. Smile



Utinam logica falsa tuam philosophiam totam suffodiant

05-29-2003 18:10 Send an Email to Heather Search for Posts by Heather Add Heather to your Buddy List
Post Reply:
Title (Optional):
Message:


Convert URLs: Automatically converts internet addresses into links by adding [url] and [/url] around them.
Email Notification: Notifies you by email every time there is a new post in this thread.
Deactivate smilies in this post.
Add Signature: Displays your signature in this post.


Tree Structure | Board Structure
Post New Thread Post Reply
Go to:


Powered by Burning Board 2.0.2 © 2001-2002 WoltLab GbR
English Translation by Satelk