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

📄 readex.ksh

📁 Solaris环境下Shell编程编程
💻 KSH
字号:
#!/bin/ksh# Script name: readex.ksh###### 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 an 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 -u3 addr1 name1 alias	# read from fd 3 read -u3 addr2 name2 alias	# read from fd 3print -u4 $name1 $addr1		# write to fd 4 (do not write aliases)print -u4 $name2 $addr2		# 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 + -