⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readex.sh

📁 Solaris环境下Shell编程编程
💻 SH
字号:
#!/bin/sh# Script name: readex.sh##### Step 1 - Copy /etc/hostscp /etc/hosts /tmp/hosts2##### Step 2 - Strip out comment linesgrep -v '^#' /tmp/hosts2 > /tmp/hosts3	##### Step 3 - fd 3 is input file /tmp/hosts3exec 3< /tmp/hosts3##### Step 4 - fd 4 is output file /tmp/hostsfinalexec 4> /tmp/hostsfinal#####  The following 4 statements accomplish STEP 5read <& 3 addr1 name1 alias	# Read from fd 3read <& 3 addr2 name2 alias	# Read from fd 3echo $name1 $addr1 >& 4		# Write to fd 4 (do not write aliases)echo $name2 $addr2 >& 4		# Write to fd 4 (do not write aliases)#####  END OF STEP 5 statementsexec 3<&-			# Step 6 - close fd 3exec 4<&-			# Step 7 - close fd 4

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -