Marco Education Class-July 28 homework
1 . Convert the contents of the/etc/issue file to uppercase and save to the/tmp/issue.out file
[[Email protected] ~]# TR ' A-Z ' A-Z ' </etc/issue | >>/tmp/issue.out[[email protected] ~]# cat/tmp/issue.out CENTOS RELEASE 6.8 (FINAL) KERNEL \ r on an \ t \n\d \smage Education learning Serviceshttp://www.magedu.com[[email Protected] ~]#
2. convert the current system login user's information to uppercase and save to the/tmp/who.out file
[Email protected] ~]# WhoAmI | Tr ' A-Z ' A-Z ' >/tmp/who.out[[email protected] ~]# cat/tmp/who.out ROOT
3 , a linux user to the root email , request the message titled "Help" , the message body is as follows:
Hello, Iam user name , thesystem version is here,please help me to
Check it,thanks!
Operating system Version Information
[Email protected] ~]# echo-e "Hello, I am ' whoami ', the system version is Here,please help me to \ncheck it, thanks! \ n ' cat/etc/centos-release ' | Mail-s "Help" Root[[email protected] ~]# cat/var/spool/mail/root
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/85/3F/wKioL1eeHozgf6MKAAC_V7v0sTM472.png "title=" QQ picture 20160731235115.png "alt=" Wkiol1eehozgf6mkaac_v7v0stm472.png "/>
4 , the /root/ file list, displayed as a line, and the file name separated by a space
[Email protected] ~]# Ls-1 | Tr ' \ n ' ' 1.log 2.log aa [a,b,c,d,e,f [a-c] anaconda-ks.cfg ETCs f f[a-c] file1 install.log install.log.syslog mail Mail. TXT Network pass TestDir w2c
5 . The contents of the File1 file are : "1 2 3 4 5 6 7" Calculate the sum of all the numbers
[[email protected] ~]# echo "1 2 3 4 5 6 7 8 9" > File1 | Cat File1 | Tr ' + ' | Bc55
6. Remove the ' ^m ' character from the Windows text file
[[email protected] ~]# echo "Windows" | Tr-d "W" indows
7 , processing string "xt.,l 1 jr#! $mn 2 c*/fe 3 uz 4", keep only the numbers and spaces
[[email protected] ~]# echo "xt.,|1 jr#/rootmn 2 c*/fe 3 uz 4" | Tr-d-C ' 0-9 \ n ' 1 2 3 4
This article from "Live by the Sea like Waves" blog, please be sure to keep this source http://zhang789.blog.51cto.com/11045979/1833102
Marco Education Class-Standard I/O and Plumbing-after-school small jobs-July 2016 28