spec > 42sh > globbing > bracket-expansion > simple-pattern > 004-multi-bracket-multi-char
The purpose of this test is to match a file name which contain a bracket as first character.
rm -rf "./test_globbing"
mkdir "./test_globbing"
cd "./test_globbing"
touch 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 21 23 24 25 26 27 28 29 ']' '[' '[12][34]' '1234'
${GLOBAL_TMP_DIRECTORY}/write_all_arguments_on_stdout [12][34]
expected_to match_regex "13@"
expected_to match_regex "14@"
expected_to match_regex "23@"
expected_to match_regex "24@"
expected_to_not match_regex "0[0-9]@"
expected_to_not match_regex "1[0-2]@"
expected_to_not match_regex "1[5-9]@"
expected_to_not match_regex "2[0-2]@"
expected_to_not match_regex "2[5-9]@"
expected_to_not match_regex "[[]@"
expected_to_not match_regex "]@"
expected_to_not match_regex "[[]12][[]34]@"
expected_to_not match_regex "1234@"
might match_regex "^13@14@23@24@$"
expected_to be_empty
The following variables may appear in this test:
- ${GLOBAL_INSTALLDIR} -> The installation directory of 42ShellTester
- ${GLOBAL_TMP_DIRECTORY} -> The temporary directory in which tests are executed
- ${GLOBAL_TOKEN} -> A token that changes value at launch time
- ${PATH} -> The standard environment variable PATH
- ${HOME} -> The standard environment variable HOME
The following binaries may appear in this test:
- ./display_env -> A binary that iterates on
**envp
and write each element on standard output. - ./display_program_name -> A binary that writes its name on standard ouput.
- ./display_pwd -> A binary that writes on standard output the absolute path of the current directory returned by
getcwd(3)
, encountered with the stringsPWD:
and:PWD
. - ./exit_with_status -> A binary that immediately exits with the status given as first argument.
- ./read_on_stdin -> A binary that reads on standard entry and write each line on standard output suffixed with the character
@
(e.g. same behavior ascat -e
and the newline character). Whenread(2)
returns-1
, then the stringSTDIN READ ERROR
is written on standard error. - ./sleep_and_exit_with_status -> A binary that sleeps for a duration in seconds given as first argument and then exits with status given as second argument.
- ./sleep_and_write_on_stderr -> A binary that sleeps for a duration in seconds given as first argument and then writes on STDERR the string given as second argument without EOL.
- ./write_all_arguments_on_stdout -> A binary that writes on standard output each argument separated by the symbol
@
. If no argument is given, it writes the string "nothing to be written on stdout". - ./write_on_stderr -> A binary that writes on standard error the first given argument (the same behavior as
echo
but with only one argument) and exits with an error status code given as second argument. If no argument is given, it writes the string "write on stderr" and exit with status1
. - ./write_on_stdout -> A binary that writes on standard output the first given argument (the same behavior as
echo
but with only one argument). If no argument is given, it writes the string "write on stdout". - ./write_on_stdout_and_stderr -> A binary that writes on standard output the first given argument, and writes on standard error the second given argument. If an argument is missing, it writes the strings "write on stdout" and "write on stderr".