Author Topic: How does the chmod command work?  (Read 1333 times)

Andrek

  • Hydlaa Resident
  • *
  • Posts: 176
  • Your mom liked it!
    • View Profile
How does the chmod command work?
« on: August 06, 2005, 09:30:27 pm »
Q: How do I use the installer?
A: Just do: chmod 755 PlaneShift_CBV0.3.010.run && sh PlaneShift_CBV0.3.010.run

Q: How do I use the update?
A: Same as installer: chmod 755 PlaneShift_CBV0.3.010-UPDATE.run && sh PlaneShift_CBV0.3.010-UPDATE.run

Why does this work?  ie what does chmod do?  As well what are the && ,sh, and 755 for?  If there is a way to ask the OS this please let me know.

Just curious.
I'm taking a shower.  Don't think of me as dirty, naked will do just fine ;)

The Doctor

  • Wayfarer
  • *
  • Posts: 8
    • View Profile
(No subject)
« Reply #1 on: August 06, 2005, 09:37:39 pm »
Quote
Originally posted by Andrek
Q: How do I use the installer?
A: Just do: chmod 755 PlaneShift_CBV0.3.010.run && sh PlaneShift_CBV0.3.010.run

Q: How do I use the update?
A: Same as installer: chmod 755 PlaneShift_CBV0.3.010-UPDATE.run && sh PlaneShift_CBV0.3.010-UPDATE.run

Why does this work?  ie what does chmod do?  As well what are the && ,sh, and 755 for?  If there is a way to ask the OS this please let me know.

Just curious.



chmod is the unix change mode command. 755 is the set of bytes that turn the file read/write/execute for the owner, read/execute for the group and read/execute for anyone else.  You can also do a chmod o+rwx for owner, or chmod a+rwx for all so that everyone can read, write and execute. The last statement is not a good one to be doing with system files, as anyone can change them.  For these files, you\'re most likely going to delete them or archive them to cd, so it\'s not a big deal.  Just don\'t leave them sitting around on a live networked filesystem.

The && is a logical AND statement.  If the first command is successful, then do the second task.

The sh Planeshift_ command tells the computer to run a shell and then interpret the Planeshift_ script.  If you are using Bash, or most other shells, you can just execute the program normally, using ./Planeshift_  . Some shells don\'t work this way, so the safest thing to do from a developer standpoint is have the end user execute it through shell (sh), which they know works.
« Last Edit: August 06, 2005, 09:40:55 pm by The Doctor »

Leeloo

  • Hydlaa Resident
  • *
  • Posts: 161
    • View Profile
(No subject)
« Reply #2 on: August 06, 2005, 10:11:31 pm »
The chmod is only necessary for ./PlaneShift_CBV0.3.010.run anyway. sh PlaneShift_CBV0.3.010.run doesn\'t need it. So, it should be either:

chmod 755 PlaneShift_CBV0.3.010.run && ./PlaneShift_CBV0.3.010.run

or

sh PlaneShift_CBV0.3.010.run

Any shell should know to run the script via /bin/sh when using ./PlaneShift_CBV0.3.010.run, the first line of the script (#!/bin/sh) tells it that.

Andrek

  • Hydlaa Resident
  • *
  • Posts: 176
  • Your mom liked it!
    • View Profile
(No subject)
« Reply #3 on: August 06, 2005, 10:42:10 pm »
[root@localhost pscb]# sh PlaneShift_CBV0.3.010.run
Creating directory ps.cb.03.010
Verifying archive integrity... All good.
Uncompressing Planeshift Crystal Blue Version 3.010..
./setup.sh: line 57: dialog: command not found
./setup.sh: line 59: dialog: command not found
./setup.sh: line 113: dialog: command not found
















Removing tmp files...
[root@localhost pscb]#


This is what I got and no install... any help would be great.
I'm taking a shower.  Don't think of me as dirty, naked will do just fine ;)

Platyna

  • Hydlaa Notable
  • *
  • Posts: 556
    • View Profile
(No subject)
« Reply #4 on: August 06, 2005, 11:41:37 pm »
Posting multiple times about one problem, bumping, spamming etc. will only
cause a thread to be locked. Development team and their cooperatives does
their best to provide a good software, comprehensive documentation and
support for users, if your post is not replied it surely not because we ignored
you or we don\'t care. As I told you before please use the documentation
before posting.


Regards.
Zuzanna K. Filutowska
RPG Players Community || Platyna\'s Planeshift Warehouse
\"The only thing necessary for evil to triumph is for good men to do nothing.\" -- Edward Burke