LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 12-20-2014, 08:34 AM   #1
MikeeeSmith
LQ Newbie
 
Registered: Dec 2014
Posts: 1

Rep: Reputation: Disabled
Script for .sh permissions


Hi all,
I'm new to Linux and I want to write a skript. Can you guys please help me?
I know it should start with:
#!/bin/bash
I would like to check if system information (I found it's done with uname -a) is the same as the system information of machine on which the script has been written. Something like script was written on system XYZ and if I use it on system ZYX it will show something like: This is not a same system on which this script was written.
I guess it's done with if... something like:
if uname -a =! current uname -a then echo "This is not..."
But I don't know syntax to scripting :/
But a main thing I want about this script is that I want it to set up run access for scripts. I manually add location to some folder and script will find .sh files if there are any and check them if they have run access set up. If they don't have run access the script will set it up. I don't have any idea of how this should be done. Is it possible it's done with this? find /path/to/toplevel/dir
I would be glad for any help. Thank you.
 
Old 12-20-2014, 09:04 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,248

Rep: Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431Reputation: 4431
Quote:
Originally Posted by MikeeeSmith View Post
Hi all,
I'm new to Linux and I want to write a skript. Can you guys please help me?
I know it should start with:
#!/bin/bash
I would like to check if system information (I found it's done with uname -a) is the same as the system information of machine on which the script has been written. Something like script was written on system XYZ and if I use it on system ZYX it will show something like: This is not a same system on which this script was written.
I guess it's done with if... something like:
if uname -a =! current uname -a then echo "This is not..."
But I don't know syntax to scripting :/
But a main thing I want about this script is that I want it to set up run access for scripts. I manually add location to some folder and script will find .sh files if there are any and check them if they have run access set up. If they don't have run access the script will set it up. I don't have any idea of how this should be done. Is it possible it's done with this? find /path/to/toplevel/dir
I would be glad for any help. Thank you.
There are many, MANY bash scripting tutorials you can easily find with a brief Google search. There is even one in my posting signature. The ones at the Linux Documentation Project (TLDP) are probably the best, and they go from beginner to advanced, with MANY examples. Start there.
 
Old 12-20-2014, 11:53 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,892
Blog Entries: 27

Rep: Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182
Member response

Hi,

Welcome to LQ!
I like to provide these links to new users;
Quote:
Just a few links to aid you to gaining some understanding;



1
Linux Documentation Project
2
Rute Tutorial & Exposition
3
Linux Command Guide
4
Bash Beginners Guide
5
Bash Reference Manual
6
Advanced Bash-Scripting Guide
7
Linux Newbie Admin Guide
8
LinuxSelfHelp
9
Ultimate Linux Newbie Guide
10
Linux Home Networking
11
Virtualization- Top 10

The above links and others can be found at '
Slackware-Links'. More than just SlackwareŽ links!
Hope this helps.
Have fun & enjoy!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing a Shell script with 654 permissions inside another shell script. changusee2k Linux - Newbie 2 06-07-2011 08:58 PM
Modify Perl script to work with txt - Permissions script joangopan Programming 4 09-14-2007 10:20 PM
Permissions in cron'ed script Xig Programming 3 02-10-2007 07:45 AM
Script to set up permissions amwink Linux - General 2 10-22-2005 10:32 AM
Script that lists #of permissions nabil Linux - General 6 04-23-2002 04:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration