bash 9 | 1/7 - atnifty.com · 2018. 4. 26. · 3 pocket bash [hide] 1. 2. 3. 4. 5.exec 6. 7. 8. ( )...
TRANSCRIPT
3 Pocket
Bash
[hide]
1.2.3.4.5.exec6.7.8. ( )9. (exitcode)
1.
UNIX OS> ( ) >>
LAN IP6
(Linux/Windows)
Teraterm8
Linux/UNIX(
~ )
find12 (+1 )
Sponsored Links
To search type and hit enter
2018 4 17
⇔ 2018 416
() 2018 4
12Linux
2018 4 1135
( ) 2018 4 10
Apple awk CentOS CUIDebian GaleraCluster GentooGraylog grep GUI HP-UX LinuxMac MariaDB MicrosoftNixOS PowerShell Proxmox Python
sed ShellScript Solaris ssh Teraterm
Tool Ubuntu UNIX VMware ESXi Vyatta Vyos Web Web
Windows
Linux Windows Mac
Home Linux Mac Windows Tool
2016 2 29 Apple 1 Comment
Bash 9
Like 0
12
> # >> #
100
1/7Bash 9 | ...
2018/04/26https://orebibou.com/2016/02/%E8%A6%9A%E3%81%88%E3%81%A6%E3%82%...
/dev/null
/dev/pts/1
2.
read
[root@test-node ~]# cat /work/command /etc [root@test-node ~]# read -r line < /work/command ;echo $line /etc
3.
cat
[root@test-node ~]# cat << EOF > /work/test_red.txt > 1234 > 5678 > 90 > EOF [root@test-node ~]# cat /work/test_red.txt 1234 5678 90
EOFEOF
Tab
Linux/UNIX(UTF-8 or
Shift_JIS or EUC-JP...)
grep14 (+3 )
Windows&
CentOS7 Samba
sed12 (+3 )
top14
@blacknon_
8
8
8
…20
bot Golang
…github.com/theoldmoon0602
Blacknon@@blacknon_
Blacknon@@blacknon_
Blacknon@@blacknon_
theoldmoon0602/……
github.com
Blacknon@
123
1> # ( ) 2> # &> #
1 echo " " > /dev/pts/1
1 3>&1 1>&2 2>&3
1 < #
123
<< EOF......EOF
123
<< EOF......EOF
2/7Bash 9 | ...
2018/04/26https://orebibou.com/2016/02/%E8%A6%9A%E3%81%88%E3%81%A6%E3%82%...
4.
cat echo( )
[root@test-node ~]# cat <<< "This Server is $(hostname)." This Server is test-node.
5.exec
exec (fork )
( PS1)
●
[root@test-node ~]# cat /work/test_sh.sh exec 2>/tmp/error_test greew grep 'aaa' /etc/hogeghogege [root@test-node ~]# sh /work/test_sh.sh [root@test-node ~]# cat /tmp/error_test /work/test_sh.sh: 2: greew: grep: /etc/hogeghogege:
●
[root@test-node ~]# exec 3</etc/fstab [root@test-node ~]# grep "" <&3 # # /etc/fstab # Created by anaconda on Sun Jan 3 08:46:04 2016 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/centos-root / xfs defaults 0 0 UUID=461b7464-714d-4a8b-9f63-19fe0482887f /boot xfs defaults 0 0 /dev/mapper/centos-home /home xfs defaults 0 0 /dev/mapper/centos-swap swap swap defaults 0 0 [root@test-node ~]# grep "" <&3 [root@test-node ~]#</pre>
●
[root@test-node ~]# exec 3>/tmp/3teest [root@test-node ~]# echo "aaaaaaaa" >&3
1 <<< " "
1 exec 2> #
1 exec 3<
1 exec 3>
GPUDC
SSH ...orebibou.com
...orebibou.com
Exc...orebibou.com
find...
orebibou.com
sed...
orebibou.com
sed...
orebibou.com
...orebibou.com
Linux...
orebibou.com
xargs...
orebibou.com
Linux/Mac...
orebibou.com
3/7Bash 9 | ...
2018/04/26https://orebibou.com/2016/02/%E8%A6%9A%E3%81%88%E3%81%A6%E3%82%...
[root@test-node ~]# cat /tmp/3teest aaaaaaaa
●
[root@test-node ~]# exec 3<>/tmp/3test [root@test-node ~]# echo "aaaaaaaa" >&3 [root@test-node ~]# [root@test-node ~]# exec 3<>/tmp/3test [root@test-node ~]# grep "" <&3 aaaaaaaa
●
[root@test-node ~]# exec 3<> /dev/tcp/127.0.0.1/22 [root@test-node ~]# echo $? 0 [root@test-node ~]# exec 3<> /dev/tcp/127.0.0.1/23 -bash: connect: -bash: /dev/tcp/127.0.0.1/23: [root@test-node ~]# echo $? 1
Sponsored Links
6.
() {}
[root@test-node ~]# (echo aaa;echo bbb) > /tmp/aaa123 [root@test-node ~]# cat /tmp/aaa123 aaa bbb [root@test-node ~]# [root@test-node ~]# { echo aaa;echo bbb; } > /tmp/aaa123_2 [root@test-node ~]# cat /tmp/aaa123_2 aaa bbb
7.
1 exec 3<>
12
exec 3<> /dev/tcp/ / # tcpexec 3<> /dev/udp/ / # udp
12
( 1; 2;...) > # { 1; 2;...; } > #
4/7Bash 9 | ...
2018/04/26https://orebibou.com/2016/02/%E8%A6%9A%E3%81%88%E3%81%A6%E3%82%...
|( )
( Process Substitution )
[root@test-node ~]# cat /work/test_sort1 2 dddddd 1 aaaaaa 5 bbbbbb 6 gfgfgr [root@test-node ~]# cat /work/test_sort2 6 gfgfgr 4 bbbbbb 1 aaaaaa 3 cfffff [root@test-node ~]# sort /work/test_sort1 1 aaaaaa 2 dddddd 5 bbbbbb 6 gfgfgr [root@test-node ~]# sort /work/test_sort2 1 aaaaaa 3 cfffff 4 bbbbbb 6 gfgfgr [root@test-node ~]# diff <(sort /work/test_sort1) <(sort /work/test_sort2) 2,3c2,3 < 2 dddddd < 5 bbbbbb --- > 3 cfffff > 4 bbbbbb
8. ( )
UNIX OS
[root@test-node ~]# grep "" /work/hostname_* /work/hostname_aaa_000.txt:aaa_000 /work/hostname_aaa_001.txt:aaa_001 /work/hostname_aaa_002.txt:aaa_002 /work/hostname_aaa_003.txt:aaa_003 /work/hostname_aaa_004.txt:aaa_004 /work/hostname_aaa_005.txt:aaa_005 /work/hostname_bbb_000.txt:aaa_000 /work/hostname_bbb_001.txt:aaa_001 /work/hostname_bbb_002.txt:aaa_002 /work/hostname_bbb_003.txt:aaa_003 /work/hostname_bbb_004.txt:aaa_004 /work/hostname_bbb_005.txt:aaa_005 [root@test-node ~]# grep "" /work/hostname_* | grep aaa_000 /work/hostname_aaa_000.txt:aaa_000 /work/hostname_bbb_000.txt:aaa_000
bash4.1
[root@test-node ~]# grep "" /work/hostneme_* grep: /work/hostneme_*: [root@test-node ~]# [root@test-node ~]# grep "" /work/hostneme_* | sed 's/work/aaaa/g' grep: /work/hostneme_*: [root@test-node ~]#
1 <( )
1 <( ) <( )
1 |
1 |&
5/7Bash 9 | ...
2018/04/26https://orebibou.com/2016/02/%E8%A6%9A%E3%81%88%E3%81%A6%E3%82%...
3 Pocket
AnsiWeather…
aproposman
a…
CentOS 7 Samba4Active Directory Domain Controller (AD DC)
Windows…
[root@test-node ~]# grep "" /work/hostneme_* |& sed 's/work/aaaa/g' grep: /aaaa/hostneme_*:
9. (exitcode)
echo $?
exitcode bash PIPESTATUS
[root@test-node ~]# grep "" /euc |& sed 's/euc/aaa/g' grep: /aaa: [root@test-node ~]# echo ${PIPESTATUS[@]} 2 0
Written by blacknon
Related Posts
This article has 1 comments
Pingback: | Full Stack Enginear
1 echo ${PIPESTATUS[@]}
! 54
1,512 (2018/04/25 22:21 )2011/08/10
175,917122
ISBN-10 4904807049ISBN-13 9784904807040
USP
Like 0
(… ) Windows UNIX
6/7Bash 9 | ...
2018/04/26https://orebibou.com/2016/02/%E8%A6%9A%E3%81%88%E3%81%A6%E3%82%...
Leave a Comment
*
AIX Apple awk CentOS CUI DebianGaleraCluster Gentoo Graylog grep HP-UX KVM
Linux Mac MariaDB Microsoft NixOSPowerShell Proxmox Python sed ShellScript SolarisSSH Teraterm Tool Ubuntu UNIX VMwareESXi
Vyatta VyOS Web Windows
Apple awk CentOS CUI DebianGaleraCluster Gentoo Graylog grep GUI HP-UXLinux Mac MariaDB Microsoft NixOSPowerShell Proxmox Python sed ShellScript Solaris ssh
Teraterm Tool Ubuntu UNIX VMware ESXi
Vyatta Vyos Web Web Windows
Powered by
コメントを送信
CentOS 7 Zabbix 3.0 Linux/UNIX ( ~ )
7/7Bash 9 | ...
2018/04/26https://orebibou.com/2016/02/%E8%A6%9A%E3%81%88%E3%81%A6%E3%82%...