Skip to content
Snippets Groups Projects
Commit 2b402921 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Wintersemester 2024/25

parent ebd82a1f
Branches
No related tags found
No related merge requests found
Showing
with 0 additions and 165 deletions
File deleted
"Praktikumsaufgabe Versuch 0"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a) Erstellen Sie mittels einer GUI eine Datei
und bearbeiten Sie diese anschließend
von der Unix-Kommandozeile aus.
b) Und umgekehrt.
3) Schauen Sie sich auf dem Rechner um.
Welche Verzeichnisse ("Ordner") und Dateien
können Sie von der Kommandozeile aus
bzw. von der GUI aus sehen?
Was bedeuten diese?
iv) Schreiben Sie ein C-Programm, z.B. "hello.c":
#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n");
return 0;
}
Compilieren Sie es mit
gcc -Wall -O hello.c -o hello
und starten Sie es von der Kommandozeile aus mit
./hello
sowie von der GUI aus.
v) Lösen Sie schon mal die Übungsaufgaben für "Hardwarenahe Programmierung".
#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n");
return 0;
}
#include <stdio.h>
int main (void)
{
printf ("Hallo, Welt!\n");
return 0;
}
20231012/Ken_Thompson_(sitting)_and_Dennis_Ritchie_at_PDP-11_(2876612463).jpg

1.88 MiB

20231012/Shopping_online_with_bank_card.jpg

1.49 MiB

../common/Zeichen_123.pdf
\ No newline at end of file
cassini/home/peter/bo/2023ws/dbs/20231012> cat > privet.c
#include <stdio.h>
int main (void)
{
printf ("Привет, мир!\n");
return 0;
}
cassini/home/peter/bo/2023ws/dbs/20231012> cat privet.c
#include <stdio.h>
int main (void)
{
printf ("Привет, мир!\n");
return 0;
}
cassini/home/peter/bo/2023ws/dbs/20231012> gcc -Wall -O privet.c -o privet
cassini/home/peter/bo/2023ws/dbs/20231012> ./privet
Привет, мир!
cassini/home/peter/bo/2023ws/dbs/20231012>
cassini/home/peter/bo/2023ws/dbs/20231012> chmod -r hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> ls -l hello.c
--w------- 1 peter peter 82 12. Okt 12:20 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> cat hello.c
cat: hello.c: Keine Berechtigung
cassini/home/peter/bo/2023ws/dbs/20231012> chmod +r hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> ls -l hello.c
-rw-r--r-- 1 peter peter 82 12. Okt 12:20 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> chmod -r hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> chmod u+r hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> ls -l hello.c
-rw------- 1 peter peter 82 12. Okt 12:20 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012>
cassini/home/peter/bo/2023ws/dbs/20231012> chmod 640 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> ls -l hello.c
-rw-r----- 1 peter peter 82 12. Okt 12:20 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> chmod 750 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> ls -l hello.c
-rwxr-x--- 1 peter peter 82 12. Okt 12:20 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> bc
bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
obase=13
ibase=13
6 * 9
42
cassini/home/peter/bo/2023ws/dbs/20231012> ls -l hello.c
-rwxr-x--- 1 peter peter 82 12. Okt 12:20 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> chmod uo+w g-x u-r hello.c
chmod: Zugriff auf 'g-x' nicht möglich: Datei oder Verzeichnis nicht gefunden
chmod: Zugriff auf 'u-r' nicht möglich: Datei oder Verzeichnis nicht gefunden
cassini/home/peter/bo/2023ws/dbs/20231012> chmod uo+w hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> chmod g-x hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> chmod u-r hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> ls -l hello.c
--wxr---w- 1 peter peter 82 12. Okt 12:20 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> chmod 775 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012>
cassini/home/peter/bo/2023ws/dbs/20231012> ls -l hello.c
-rwxrwxr-x 1 peter peter 82 12. Okt 12:20 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> cat hello.c
#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n");
return 0;
}
cassini/home/peter/bo/2023ws/dbs/20231012> ./hello.c
./hello.c: Zeile 3: Syntaxfehler beim unerwarteten Symbol »(«
./hello.c: Zeile 3: `int main (void)'
cassini/home/peter/bo/2023ws/dbs/20231012> # Dies ist ein Kommentar. ;-)
cassini/home/peter/bo/2023ws/dbs/20231012>
20231012/computer-arbeitsplaetze-lores.jpg

89.6 KiB

Computergebouw_van_KLM_voor_automatische_boekingsmethode_Corda_in_Amstelveen._,_Bestanddeelnr_923-3365.jpg
\ No newline at end of file
cassini/home/peter/bo/2023ws/dbs/20231012> cp hello.c hallo.c
cassini/home/peter/bo/2023ws/dbs/20231012> ls -l h*.c
-rw-r--r-- 1 peter peter 82 12. Okt 12:11 hallo.c
-rw-r--r-- 1 peter peter 82 12. Okt 11:45 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> cp -p hello.c hallo.c
cassini/home/peter/bo/2023ws/dbs/20231012> ls -l h*.c
-rw-r--r-- 1 peter peter 82 12. Okt 11:45 hallo.c
-rw-r--r-- 1 peter peter 82 12. Okt 11:45 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012> cp -p -i hello.c hallo.c
cp: 'hallo.c' überschreiben? n
cassini/home/peter/bo/2023ws/dbs/20231012> cp -pi hello.c hallo.c
cp: 'hallo.c' überschreiben? j
cassini/home/peter/bo/2023ws/dbs/20231012> ls -l h*.c
-rw-r--r-- 1 peter peter 82 12. Okt 11:45 hallo.c
-rw-r--r-- 1 peter peter 82 12. Okt 11:45 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012>
cassini/home/peter/bo/2023ws/dbs/20231012> mkdir test
cassini/home/peter/bo/2023ws/dbs/20231012> cd test
cassini/home/peter/bo/2023ws/dbs/20231012/test> cp -p ../h*.c .
cassini/home/peter/bo/2023ws/dbs/20231012/test> ls -l
insgesamt 8
-rw-r--r-- 1 peter peter 82 12. Okt 11:45 hallo.c
-rw-r--r-- 1 peter peter 82 12. Okt 11:45 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012/test> rm h*.c
cassini/home/peter/bo/2023ws/dbs/20231012/test> ls -l
insgesamt 0
cassini/home/peter/bo/2023ws/dbs/20231012/test>
cassini/home/peter/bo/2023ws/dbs/20231012/test> cp -p ../h*.c
cassini/home/peter/bo/2023ws/dbs/20231012/test> ls -l
insgesamt 0
cassini/home/peter/bo/2023ws/dbs/20231012/test> cd ..
cassini/home/peter/bo/2023ws/dbs/20231012> ls -l h*.c
-rw-r--r-- 1 peter peter 82 12. Okt 11:45 hallo.c
-rw-r--r-- 1 peter peter 82 12. Okt 11:45 hello.c
cassini/home/peter/bo/2023ws/dbs/20231012>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment