У нас вы можете посмотреть бесплатно Understanding linux basic bash shell expansions and pattern matching или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Match File Names with Shell Expansions Objectives- Efficiently run commands that affect many files by using pattern matching features of the Bash shell. This Topic is also very useful for shell scripting- Command-line Expansions When you type a command at the Bash shell prompt, the shell processes that command line through multiple expansions before running it. You can use these shell expansions to perform complex tasks that would otherwise be difficult or impossible. Following are the main expansions that Bash shell performs: 1. Brace expansion, which can generate multiple strings of characters{ ..} 2. Tilde expansion, which expand to a path to a user home directory(~) 3. Variable expansion, which replaces text with the value that is stored in a shell variable. $var 4. Command substitution, which replaces text with the output of a command. date 5. Pathname Expansions 5. Pathname expansion, which helps to select one or more files by pattern matching Pathname expansion, historically called globbing, is one of the most useful features of Bash. With this feature, it is easier to manage many files. By using metacharacters that "expand" to match the file and path names that you are looking for, commands can act on a focused set of files at once. Pathname Expansion and Pattern Matching Pathname expansion expands a pattern of special characters that represent wild cards or classes of characters into a list of file names that match the pattern. Before the shell runs your command, it replaces the pattern with the list of file names that matched. If the pattern does not match anything, then the shell tries to use the pattern as a literal argument for the command that it runs. The following table lists common metacharacters and pattern classes that are used for pattern matching. Table of Metacharacters and Matches- Pattern Matches Any string of zero or more characters ? Any single character [abc…] Any one character in the enclosed class (between the square brackets) [!abc…] Any one character not in the enclosed class [^abc…] Any one character not in the enclosed class [[:alpha:]] Any alphabetic character [[:lower:]] Any lowercase character [[:upper:]] Any uppercase character [[:alnum:]] Any alphabetic character or digit [[:punct:]] Any printable character that is not a space or alphanumeric [[:digit:]] Any single digit from 0 to 9 [[:space:]] Any single white space character, which might include tabs, newlines, carriage returns, form feeds, or spaces Brace Expansion- Brace expansion is used to generate discretionary strings of characters. Braces contain a comma- separated list of strings, or a sequence expression. The result includes the text that precedes or follows the brace definition. Brace expansions might be nested, one inside another. You can also use double-dot syntax (..), which expands to a sequence. For example, the {m..p} double-dot syntax inside braces expands to m n o p. Tilde Expansion The tilde character (~), matches the current user's home directory. If it starts with a string of characters other than a slash (/), then the shell interprets the string up to that slash as a username, if one matches, and replaces the string with the absolute path to that user's home directory. If no username matches, then the shell uses an actual tilde followed by the string of characters v