040 wildcards in scripts kho tài liệu training

10 14 0
  • Loading ...
1/10 trang

Thông tin tài liệu

Ngày đăng: 17/11/2019, 08:18

Wildcards in Shell Scripts LinuxTrainingAcademy.com What You Will Learn ● How to use wildcards in your shell scripts LinuxTrainingAcademy.com Why use wildcards? ● Wildcards are great when you want to work on a group of files or directories LinuxTrainingAcademy.com Just like a regular command line #!/bin/bash cd /var/www cp *.html /var/www-just-html LinuxTrainingAcademy.com In a for loop #!/bin/bash cd /var/www for FILE in *.html echo "Copying $FILE" cp $FILE /var/www-just-html done LinuxTrainingAcademy.com Output: Copying about.html Copying contact.html Copying index.html LinuxTrainingAcademy.com In a for loop #!/bin/bash for FILE in /var/www/*.html echo "Copying $FILE" cp $FILE /var/www-just-html done LinuxTrainingAcademy.com Output: Copying /var/www/about.html Copying /var/www/contact.html Copying /var/www/index.html LinuxTrainingAcademy.com In a for loop #!/bin/bash for FILE in *.html echo "Copying $FILE" cp $FILE /var/www-just-html done LinuxTrainingAcademy.com Summary ● ● Just like on the command line In a loop LinuxTrainingAcademy.com ... done LinuxTrainingAcademy.com Output: Copying about.html Copying contact.html Copying index.html LinuxTrainingAcademy.com In a for loop #!/bin/bash for FILE in /var/www/*.html echo "Copying $FILE"... done LinuxTrainingAcademy.com Output: Copying /var/www/about.html Copying /var/www/contact.html Copying /var/www/index.html LinuxTrainingAcademy.com In a for loop #!/bin/bash for FILE in *.html... ● How to use wildcards in your shell scripts LinuxTrainingAcademy.com Why use wildcards? ● Wildcards are great when you want to work on a group of files or directories LinuxTrainingAcademy.com
- Xem thêm -

Xem thêm: 040 wildcards in scripts kho tài liệu training , 040 wildcards in scripts kho tài liệu training

Gợi ý tài liệu liên quan cho bạn