楼主: cmwei333
2228 6

Wicked Cool Shell Scripts: 101 Scripts for Linux, OS X and UNIX Systems (16, 2e) [推广有奖]

贵宾

泰斗

1%

还不是VIP/贵宾

-

TA的文库  其他...

【历史+心理学+社会自然科学】

【数学+统计+计算机编程】

【金融+经济+商学+国际政治】

威望
6
论坛币
3566819 个
通用积分
717.2193
学术水平
4324 点
热心指数
4647 点
信用等级
3954 点
经验
362256 点
帖子
9826
精华
9
在线时间
2842 小时
注册时间
2015-2-9
最后登录
2017-1-29

初级热心勋章 中级热心勋章 高级热心勋章 初级信用勋章 中级信用勋章 初级学术勋章 特级热心勋章 中级学术勋章 高级信用勋章 高级学术勋章 特级学术勋章 特级信用勋章

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
Wicked Cool Shell Scripts, 2nd Edition
101 Scripts for Linux, OS X, and UNIX Systems

by Dave Taylor and Brandon Perry

cover.png

Shell scripts are an efficient way to interact with your machine and manage your files and system operations. With just a few lines of code, your computer will do exactly what you want it to do. But you can also use shell scripts for many other essential (and not-so-essential) tasks.

This second edition of Wicked Cool Shell Scripts offers a collection of useful, customizable, and fun shell scripts for solving common problems and personalizing your computing environment. Each chapter contains ready-to-use scripts and explanations of how they work, why you’d want to use them, and suggestions for changing and expanding them. You’ll find a mix of classic favorites, like a disk backup utility that keeps your files safe when your system crashes, a password manager, a weather tracker, and several games, as well as 23 brand-new scripts, including:

A ZIP code lookup tool that reports the city and state
A Bitcoin address information retriever
A suite of tools for working with cloud services like Dropbox and iCloud
Tools for renaming and applying commands to files in bulk
Image processing and editing tools

Whether you want to save time managing your system or just find new ways to goof off, these scripts are wicked cool!

Table of Contents

Chapter 1: The Missing Code Library
Chapter 2: Improving on User Commands
Chapter 3: Creating Utilities
Chapter 4: Tweaking Unix (AVAILABLE NOW)
Chapter 5: System Administration: Managing Users
Chapter 6: System Administration: System Maintenance
Chapter 7: Web and Internet Users
Chapter 8: Webmaster Hacks
Chapter 9: Web and Internet Administration
Chapter 10: Internet Server Administration
Chapter 11: OS X Scripts
Chapter 12: Shell Script Fun and Games
Chapter 13: Working with the Cloud
Chapter 14: ImageMagick and Working with Graphics Files
Chapter 15: Days and Dates

Appendix A: Installing Bash on Windows 10
Appendix B: Bonus Scripts

原版 PDF + Source files:

本帖隐藏的内容

原版 PDF:
101 Scripts for Linux, OS X, and UNIX Systems (2nd Edition).pdf (10.59 MB, 需要: 20 个论坛币)

PDF 压缩包:
101 Scripts for Linux, OS X, and UNIX Systems (2nd Edition).zip (10.06 MB, 需要: 20 个论坛币) 本附件包括:
  • 101 Scripts for Linux, OS X, and UNIX Systems (2nd Edition).pdf


Source files:
WickedCoolShellScripts2e_resources_updated.zip (367.88 KB, 需要: 1 个论坛币)



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Scripts Systems script System scrip collection efficient essential computer exactly

已有 1 人评分经验 论坛币 收起 理由
Nicolle + 100 + 100 精彩帖子

总评分: 经验 + 100  论坛币 + 100   查看全部评分

本帖被以下文库推荐

bbs.pinggu.org/forum.php?mod=collection&action=view&ctid=3257
bbs.pinggu.org/forum.php?mod=collection&action=view&ctid=3258
bbs.pinggu.org/forum.php?mod=collection&action=view&ctid=3259
沙发
soccy 发表于 2016-11-29 05:38:50 |只看作者 |坛友微信交流群
......

使用道具

藤椅
zhaosl 发表于 2016-11-29 07:56:54 |只看作者 |坛友微信交流群

使用道具

板凳
Lisrelchen 发表于 2016-11-30 10:01:21 |只看作者 |坛友微信交流群

#1 Finding Programs in the PATH

  1. The Code
  2. #!/bin/bash
  3. # inpath--Verifies that a specified program is either valid as is
  4. # or can be found in the PATH directory list
  5. in_path()
  6. {
  7. # Given a command and the PATH, tries to find the command. Returns 0 if
  8. # found and executable; 1 if not. Note that this temporarily modifies
  9. # the IFS (internal field separator) but restores it upon completion.
  10. cmd=$1 ourpath=$2 result=1
  11. oldIFS=$IFS IFS=":"
  12. for directory in "$ourpath"
  13. do
  14. if [ -x $directory/$cmd ] ; then
  15. result=0 # If we're here, we found the command.
  16. fi
  17. done
  18. IFS=$oldIFS
  19. return $result
  20. }
  21. checkForCmdInPath()
  22. {
  23. var=$1
  24. if [ "$var" != "" ] ; then  if [ "${var:0:1}" = "/" ] ; then  if [ ! -x $var ] ; then
  25. return 1
  26. fi
  27. 12 Chapter 1
  28.  elif ! in_path $var "$PATH" ; then
  29. return 2
  30. fi
  31. fi
  32. }
复制代码

使用道具

报纸
Lisrelchen 发表于 2016-11-30 10:02:43 |只看作者 |坛友微信交流群

#2 Validating Input: Alphanumeric Only

  1. The Code
  2. #!/bin/bash
  3. # validAlphaNum--Ensures that input consists only of alphabetical
  4. # and numeric characters
  5. validAlphaNum()
  6. {
  7. # Validate arg: returns 0 if all upper+lower+digits; 1 otherwise
  8. # Remove all unacceptable chars.  validchars="$(echo $1 | sed -e 's/[^[:alnum:]]//g')"
  9.  if [ "$validchars" = "$1" ] ; then
  10. return 0
  11. else
  12. return 1
  13. fi
  14. }
  15. # BEGIN MAIN SCRIPT--DELETE OR COMMENT OUT EVERYTHING BELOW THIS LINE IF
  16. # YOU WANT TO INCLUDE THIS IN OTHER SCRIPTS.
  17. # =================
  18. /bin/echo -n "Enter input: "
  19. read input
  20. # Input validation
  21. if ! validAlphaNum "$input" ; then
  22. echo "Please enter only letters and numbers." >&2
  23. exit 1
  24. 16 Chapter 1
  25. else
  26. echo "Input is valid."
  27. fi
  28. exit 0
  29. Listing 1-3: The validalnum script
复制代码

使用道具

地板
maxchen 发表于 2016-11-30 16:36:35 |只看作者 |坛友微信交流群
这个可以看看

使用道具

7
leon_9930754 发表于 2016-12-11 09:30:37 |只看作者 |坛友微信交流群
谢谢分享

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加JingGuanBbs
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-19 19:07