• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

Script ausführbar machen

hi ich bin neuhabe auch schon gegoogelt und im forum gesucht leider fehlen mir auch noch die kentnisse in der fachsprache. ich will keine dummen bemerkungen hören ;-)
danke *g*

nein mal im ernst mein problem ist ich mus ein ausführbares scipt erstellen für wc3

#!/bin/sh
# Den folgenden Pfad anpassen:
cd /Pfad/zu/war3
wine War3.exe -- War3.exe -opengl

nur weis ich nur den code nix weiter also wie ich eine dateierstellen kann wo ich dann draufklicke und diese dann auch startet das spiel und nicht nur der root nutzer soll es nutzen sondern alle am pc.

danke im vorraus
 
Also du erstellst eine Datei mit dem Code und gibst der Datei dann Ausführrechte (chmod 755 Dateiname). Dann sollte die Datei mit Klick zum Öffnen gehen.
 
Hi!
Wenn schon nicht über okatle Angaben dann wenigstens chmod ugo+rx dateiname, sonst wirds evtl. ja doch nur für den Scriptersteller ausführbar und nicht für alle wies ja werden soll :)
Bis denne,
Tom
 
hmm klapt mal wieder alles net die datei ist jetzt zwar mit so einen schwarzen fenster versehen aber wenn ich diese anklicke dann passiert nix
 
in der konsole sagt er mir

constan@linux:~> cd usr/bin/wc3/
bash: cd: usr/bin/wc3/: Datei oder Verzeichnis nicht gefunden

und unter root findet er das verzeichnis
 
ups sry habe ich selber gerade gesehen gehabt, dummer fehler von mir naja rechtschreibung muss gelernt sein. lol

danke nochmal
 
TomcatMJ schrieb:
Hi!
Wenn schon nicht über okatle Angaben dann wenigstens chmod ugo+rx dateiname, sonst wirds evtl. ja doch nur für den Scriptersteller ausführbar und nicht für alle wies ja werden soll :)
Bis denne,
Tom

bitte lies vorher die manpage,
A combination of the letters `ugoa' controls which users' access to the
file will be changed: the user who owns it (u), other users in the
file's group (g), other users not in the file's group (o), or all users
(a). If none of these are given, the effect is as if `a' were given,
but bits that are set in the umask are not affected.
nur ein +x entspricht einem ugo+x oder einem a+x
 
Hi!
TeXpert schrieb:
...

bitte lies vorher die manpage,
A combination of the letters `ugoa' controls which users' access to the
file will be changed: the user who owns it (u), other users in the
file's group (g), other users not in the file's group (o), or all users
(a). If none of these are given, the effect is as if `a' were given,
but bits that are set in the umask are not affected.
nur ein +x entspricht einem ugo+x oder einem a+x

Ähm,von welchem System hast du diese Manpage aus der du da zitiertest? Sowohl auf meinem SuSE 9.2 Pro mit KDE 3.4 als auch auf meinem beiden BSD-Rechnern und meinem OpenStep Rechner und auch in meinem System V Buch kann ich diese Formulierung so nicht finden,da steht eher schon drin das ohne die Angabe nicht genau feststeht was dabei rauskommt da es dann noch von den acl's und der umask nämlich abhängt. Dazu ein Zitat aus der manpage die ich hier im Konqueror ganz einfach mit man:chmod aufgerufen habe (bietet sich für Copy&Paste jja an*G*):
EXTENDED DESCRIPTION
...
The permcopy symbols u, g, and o shall represent the current permissions associated with the user, group, and other parts of the file mode bits, respectively. For the remainder of this section, perm refers to the non-terminals perm and permcopy in the grammar.

If multiple actionlists are grouped with a single wholist in the grammar, each actionlist shall be applied in the order specified with that wholist. The op symbols shall represent the operation performed, as follows:

+
If perm is not specified, the '+' operation shall not change the file mode bits.


If who is not specified, the file mode bits represented by perm for the owner, group, and other permissions, except for those with corresponding bits in the file mode creation mask of the invoking process, shall be set.

Otherwise, the file mode bits represented by the specified who and perm values shall be set.

-
If perm is not specified, the '-' operation shall not change the file mode bits.


If who is not specified, the file mode bits represented by perm for the owner, group, and other permissions, except for those with corresponding bits in the file mode creation mask of the invoking process, shall be cleared.
...
Genauere Angabe welche Rubrik der Manpage die ich da im Konqueror zu Gesicht bekam: man:/usr/share/man/man1p/chmod.1p.gz
sollte also ebenso auf normalen SuSE-Linuxsystem,en damit direkt auffindbar sein zur Überprüfung.
Da ich ab und zu eben auch mal mit anderen Unix-Systemen arbeite hab ich mir halt angewöhnt bei solchen Aktionen wie Dateirechteverwaltungsaufgaben eben undefinierte Zustände zu vermeiden da sich eben NICHT jedes Unixoide System bei lückenhaften Definitionen gleich verhält...manchmal wechseln die Reaktionsarten bei undefinierten Zuständen ja schon nach einem Releasewechsel und dann sucht man sich nen Wolf wenn man sich da im Vorfeld schon Hobbyadminmäßige Schlunzerei angewöhnt hat...
Bis denne,
Tom[/u]
 
dann macht Deine Suse da Mist :(

Version ist gnu/coreutils 5.2.1 auf einem Debian-System, aber das gleiche Verhalten hat auch meine alte 9.2er Suse gezeigt... (sauberes GNU/Linux :) ) kannst Dir ja auch die manpage im Original-Paket auf http://directory.fsf.org/coreutils.html ansehen

CHMOD

Section: User Commands (1)

NAME


chmod - change file access permissions

SYNOPSIS


chmod [OPTION]... MODE[,MODE]... FILE...
chmod [OPTION]... OCTAL-MODE FILE...
chmod [OPTION]... --reference=RFILE FILE...

DESCRIPTION


This manual page documents the GNU version of chmod. chmod changes the permissions of each given file according to mode, which can be either a symbolic representation of changes to make, or an octal number representing the bit pattern for the new permissions.

The format of a symbolic mode is `[ugoa...][[+-=][rwxXstugo...]...][,...]'. Multiple symbolic operations can be given, separated by commas.

A combination of the letters `ugoa' controls which users' access to the file will be changed: the user who owns it (u), other users in the file's group (g), other users not in the file's group (o), or all users (a). If none of these are given, the effect is as if `a' were given, but bits that are set in the umask are not affected.

...

AUTHOR
Written by David MacKenzie and Jim Meyering.

REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.

COPYRIGHT
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.

SEE ALSO
The full documentation for chmod is maintained as a Texinfo manual. If the info and chmod programs are properly installed at
your site, the command

info coreutils chmod

should give you access to the complete manual.

chmod (coreutils) 5.2.1 July 2004 CHMOD(1)
 
Ahja!
Da haben wir ja auch schon den Unterschied...ich hab hier nämlich nicht die FSF/Linux-only Manpageversion sondern die aus dem Posix-Standard entnommene Version der Opengroup an die sich komischerweise ja so ziemlich alle Kommerziellen Unix-Anbieter halten(IBM,HP,SUN,FSC usw. usf. ...)

(den langen Teil spar ich mir da der um einiges ausführlicher ist als deine Mini-Manpage da)...
...
SEE ALSO


ls , umask , the System Interfaces volume of IEEE Std 1003.1-2001, chmod ()
COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Ich sag ja,manchmal ist da schon ein unterschied zwischen Professionell-kommerziellen Systemen die schon etliche Zeit auf dem Markt sind und schnelllebigeren (nicht unbedingt minderprofessionellen) Open-Source Derivaten denn der Posix-Standard besteht ja nu nicht erst seit letztem Jahr aber im Heimanwenderbereich hat sich bisher ja noch kein wirklich Posix-konformes System durchsetzen können weils für Heimanwender eben der totale Overkill wäre was man da alles für im Kopf haben muss und wo man eben mit 6-7 Scripten und bischen fixer Klickerei in Kombination eben nich mehr auskommt...ich bevorzug es daher immer noch es lieber einmal ordentlich zu lernen und es dafür dann am ende auch zu können statt mir einen maroden Wissensflickenteppich zu basteln wo ich doch nen sauberen Wissensmarmorboden langsam aufbauen kannmauch wenn der eben Zeitaufwändiger ist,trotzdem hält der dann auch länger*G*

Bis denne,
Tom (der als hauptberuflicher Netzwerkadmin im heterogenen Netzwerkbereich/SAP-Netweaveradmin schluderei hasst wie die Pest da er die Schludereien anderer meist nämlich wieder ausbügeln muss am Ende damit nicht alles wegkracht*G*)
 
Nachtrag:
Hab noch ein nettes Beispiel gefunden in den man-pages(ja,ich hab auch noch ein Debian auf nem alten Rechner gehabt wo ich mal eben nachgucken konnte*G*) wo man sehen kann das Linux eben doch kein wirkliches Posix-konformes Unix ist sondern eben unix-(sehr)ähnliches System ist: Beim Befehl "uname" der für Systemadministration nicht so unwichtig ist wie man auf den ersten Blick meint wenn man nur PC-Unices kennt:

1.:Linux Man-Page zu uname:

UNAME
Section: User Commands (1)
NAME
uname - print system information
SYNOPSIS
uname [OPTION]...
DESCRIPTION


Print certain system information. With no OPTION, same as -s.

-a, --all
print all information, in the following order:
-s, --kernel-name
print the kernel name
-n, --nodename
print the network node hostname
-r, --kernel-release
print the kernel release
-v, --kernel-version
print the kernel version
-m, --machine
print the machine hardware name
-p, --processor
print the processor type
-i, --hardware-platform
print the hardware platform
-o, --operating-system
print the operating system
--help
display this help and exit
--version
output version information and exit
AUTHOR
Written by David MacKenzie.
REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.
COPYRIGHT
Copyright © 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SEE ALSO
The full documentation for uname is maintained as a Texinfo manual. If the info and uname programs are properly installed at your site, the command
info coreutils uname


should give you access to the complete manual.

Sehr kurz,sehr knapp und bei weitem nicht alle Features so wie es Posix-konform wäre für ein echtes Unix (siehe z.B. den Parameter -s oder den Parameter -n im Vergleich)...

2.:posix-konforme Unix-Man-Page zum Befehl uname:
UNAME
Section: PMisc. Reference Manual Pages (P)
NAME
uname - return system name
SYNOPSIS


uname [-snrvma]
DESCRIPTION


By default, the uname utility shall write the operating system name to standard output. When options are specified, symbols representing one or more system characteristics shall be written to the standard output. The format and contents of the symbols are implementation-defined. On systems conforming to the System Interfaces volume of IEEE Std 1003.1-2001, the symbols written shall be those supported by the uname() function as defined in the System Interfaces volume of IEEE Std 1003.1-2001.
OPTIONS


The uname utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.

The following options shall be supported:

-a
Behave as though all of the options -mnrsv were specified.
-m
Write the name of the hardware type on which the system is running to standard output.
-n
Write the name of this node within an implementation-defined communications network.
-r
Write the current release level of the operating system implementation.
-s
Write the name of the implementation of the operating system.
-v
Write the current version level of this release of the operating system implementation.




If no options are specified, the uname utility shall write the operating system name, as if the -s option had been specified.
OPERANDS


None.
STDIN


Not used.
INPUT FILES


None.
ENVIRONMENT VARIABLES


The following environment variables shall affect the execution of uname:

LANG
Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of IEEE Std 1003.1-2001, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)
LC_ALL
If set to a non-empty string value, override the values of all the other internationalization variables.
LC_CTYPE
Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).
LC_MESSAGES
Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
NLSPATH
Determine the location of message catalogs for the processing of LC_MESSAGES .


ASYNCHRONOUS EVENTS


Default.
STDOUT


By default, the output shall be a single line of the following form:



"%s, <sysname>




If the -a option is specified, the output shall be a single line of the following form:



"%s %s %s %s %s, <sysname>, <nodename>, <release>,
<version>, <machine>




Additional implementation-defined symbols may be written; all such symbols shall be written at the end of the line of output before the <newline>.

If options are specified to select different combinations of the symbols, only those symbols shall be written, in the order shown above for the -a option. If a symbol is not selected for writing, its corresponding trailing <blank>s also shall not be written.
STDERR


The standard error shall be used only for diagnostic messages.
OUTPUT FILES


None.
EXTENDED DESCRIPTION


None.
EXIT STATUS


The following exit values shall be returned:

0
The requested information was successfully written.
>0
An error occurred.


CONSEQUENCES OF ERRORS


Default.

The following sections are informative.
APPLICATION USAGE


Note that any of the symbols could include embedded <space>s, which may affect parsing algorithms if multiple options are selected for output.

The node name is typically a name that the system uses to identify itself for inter-system communication addressing.
EXAMPLES


The following command:



uname -sr




writes the operating system name and release level, separated by one or more <blank>s.
RATIONALE


It was suggested that this utility cannot be used portably since the format of the symbols is implementation-defined. The POSIX.1 working group could not achieve consensus on defining these formats in the underlying uname() function, and there was no expectation that this volume of IEEE Std 1003.1-2001 would be any more successful. Some applications may still find this historical utility of value. For example, the symbols could be used for system log entries or for comparison with operator or user input.
FUTURE DIRECTIONS


None.
SEE ALSO


The System Interfaces volume of IEEE Std 1003.1-2001, uname()
COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Wie man sieht geht die Posix-Konforme Version der Man-Page auch auf die Umgebungsvariablen ein die Einfluß auf uname haben und die Erklärungen der Parameter sind wesentlich präzisiert in ihren Formulierungen, so das keine Irrtümlichen Annahmen so leicht reininterpretiert werden können wie bei der Linux-Variante der Man-Page und je weniger Irrtümer aufkommen über die Leistung des Befehls desto präziser kann man ihn auch als Admin dann sinnvoll einsetzen find ich (z.B. für Wartungsaufgaben eingebunden in Scripte die dann wiederum Ausgaben des Befehls auswerten um auf dedizierte Arten dann zu reagieren,je genauer da die spezifizierungen sind desto zuverlässiger wird das Ergebnis der Proggerei am Ende dann auch sein).

Hm,vielleicht sollte man aus dem Themenbereich doch besser einen eigenen Thread machen?

Bis denne,
Tom (der zwischendurch währen der Erstellung dieses Posts mal wieder etwas Telefonsupport leisten musste für jemanden der RTFM beharrlich ignoriert*G*)
 
Moment! POSIX ist eine Sache, aber GNU ist etwas anderes...


erst noch mal ein Beispiel zu chmod:
If who is omitted, it defaults to a, but the setting
of the file mode creation mask (see umask in sh(1) or
csh(1) for more information) is taken into account.
When who is omitted, chmod will not override the res-
trictions of your user mask.
das stammt aus der manpage von SunOS5.9 (ich hab jetzt remote gerade keinen Zugriff auf andere Maschinen...)


jetzt zu GNU, Novell/Suse und Professionalität. Ich hab gerade mal auf den Seiten von Novell nachgesehen: Suse9.3 Pro nutzt die Alpha-Version 5.3 der GNU-Coreutils (http://www.novell.com/products/linuxpackages/professional/coreutils.html) der Enterprise-Kram 9 nutzt die Stable-Version 5.2.1 der GNU-Coreutils (http://www.novell.com/products/linuxpackages/enterpriseserver/i386/coreutils.html)
aber auch bei der Alpha-Version ist das gleiche Verhalten in der manpage angegeben.

und ich muss sagen dann Erwarte ich auch von suse, dass die sich genauso verhalten wie alle anderen GNU/Linux-Derivate auch. Dazu kommt, dass Du auf vielen auch kommerziellen unixen mittlerweile die GNU-Fileutilities findest, zumindest auf vielen (allen?) der SGIs (Irix) auf denen ich arbeite habe ich die vorgefunden.
 
Oben