タグ: programming
Command Line Interface Guidelines
UNIX コマンド
dotinstall:~ $ echo ‘data’
data
dotinstall:~ $ echo ‘date’ > commands.txt
dotinstall:~ $ cat commands.txt
date
dotinstall:~ $ echo ‘cal’ > commands.txt
dotinstall:~ $ cat commands.txt
cal
dotinstall:~ $ echo ‘date’ >> commands.txt
dotinstall:~ $ cat commands.txt
cal
date
dotinstall:~ $ /bin/ash < commands.txt
September 2023
Su Mo Tu We Th Fr Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Tue Sep 12 06:18:41 JST 2023
dotinstall:~ $ /bin/ash < commands.txt > results.txt
dotinstall:~ $ cat results.txt
September 2023
Su Mo Tu We Th Fr Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Tue Sep 12 06:19:05 JST 2023
dotinstall:~ $ rm *
dotinstall:~ $
C# 列挙型
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Threading; // You need to include this namespace for threads
public class TestScript : MonoBehaviour
{ public enum ACTION_TYPE
{
JUMP = 0,
ATTACL = 1,
DEFENCE = 2
}
private void Start()
{
ACTION_TYPE actionType;
actionType = ACTION_TYPE_JUMP;
switch(actionType)
{
case ACTION_TYPE_JUMP:
break;
case ACTION_TYPE.ATTACK:
break;
case ACTION_TYPE.DEFENCE:
break;
}
}
}
UNIX コマンド
dotinstall:~ $ ls -l
total 4
-rwxr–r– 1 dotinsta wheel 30 Sep 11 19:20 hello
dotinstall:~ $ echo $PATH
/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
dotinstall:~ $ export PATH=/home/dotinstall:$PATH
dotinstall:~ $ echo $PATH
/home/dotinstall:/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
dotinstall:~ $ hello
bash: /home/dotinstall/hello: bin/ash: bad interpreter: No such file or directory
dotinstall:~ $ hallo
bash: hallo: command not found
dotinstall:~ $ cd ..
dotinstall:/home $ which hello
/home/dotinstall/hello
dotinstall:/home $ $PATH
bash: /home/dotinstall:/usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin: No such file or directory
dotinstall:/home $ cd
dotinstall:~ $ rm hello
dotinstall:~ $
UNIX コマンド
dotinstall:~ $ ls
dotinstall:~ $ vi hello
dotinstall:~ $ cat hello
!bin/ash
echo ‘Hello there!’
dotinstall:~ $ vi hello
dotinstall:~ $ cat hello
!bin/ash
echo ‘Hello there!’
dotinstall:~ $
UNIX コマンド
dotinstall:~ $ vi hello
dotinstall:~ $:q
UNIX コマンド
dotinstall:~ $ ls -l /exc/shadow
ls: /exc/shadow: No such file or directory
dotinstall:~ $ ls -l /etc/shadow
-rw-r—– 1 root shadow 454 Sep 23 2020 /etc/shadow
dotinstall:~ $ cat /etc/shadow
cat: can’t open ‘/etc/shadow’: Permission denied
dotinstall:~ $ sudo !!
sudo cat /etc/shadow
root:!::0:::::
bin:!::0:::::
daemon:!::0:::::
adm:!::0:::::
lp:!::0:::::
sync:!::0:::::
shutdown:!::0:::::
halt:!::0:::::
mail:!::0:::::
news:!::0:::::
uucp:!::0:::::
operator:!::0:::::
man:!::0:::::
postmaster:!::0:::::
cron:!::0:::::
ftp:!::0:::::
sshd:!::0:::::
at:!::0:::::
squid:!::0:::::
xfs:!::0:::::
games:!::0:::::
cyrus:!::0:::::
vpopmail:!::0:::::
ntp:!::0:::::
smmsp:!::0:::::
guest:!::0:::::
nobody:!::0:::::
dotinstall:!:18528:0:99999:7:::
dotinstall:~ $ sudo
UNIX コマンド
dotinstall:~ $ ls
dotinstall:~ $ touch index.html
dotinstall:~ $ ls -l
total 0
-rw-r–r– 1 dotinsta wheel 0 Sep 8 21:06 index.html
dotinstall:~ $ rm -index.html
rm: unrecognized option: n
BusyBox v1.31.1 () multi-call binary.
Usage: rm [-irf] FILE…
Remove (unlink) FILEs
-i Always prompt before removing
-f Never prompt
-R,-r Recurse
dotinstall:~ $ ls
index.html
dotinstall:~ $ rm – index.html
rm: can’t remove ‘-‘: No such file or directory
dotinstall:~ $ rm – index.html
rm: can’t remove ‘-‘: No such file or directory
rm: can’t remove ‘index.html’: No such file or directory
dotinstall:~ $ ls
dotinstall:~ $
C# 変数
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class test3 : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
int a;
float b;
string c;
bool d;
a = 1;
b = 0.01f;
c = "勇者の登場";
d = true;
//コンソールに表示
Debug.Log(a);
Debug.Log(b);
Debug.Log(c);
Debug.Log(d);
}
}
