Giter Club home page Giter Club logo

minishell's People

Contributors

hayashi-ay avatar katataku avatar

Stargazers

 avatar

Watchers

 avatar

minishell's Issues

ヒアドキュメント

仕様

対応する仕様

  • <<-については、-を普通の文字として解釈する
  • ヒアドキュメント内の$変数の展開に対応
  • クオート(ダブル、シングル)で囲われている場合は$変数を展開しない
  • wordがクオートされている場合は区切り文字からは取り除く
  • 区切り文字は展開しない

対応しない仕様

  • <<-については対応しない
  • $変数以外の展開はしない

ドキュメント

課題要件(関連項目)

  • << should be given a delimiter, then read the input until a line containing the
    delimiter is seen. However, it doesn’t have to update the history!
  • Handle ’ (single quote) which should prevent the shell from interpreting the metacharacters in the quoted sequence.
  • Handle " (double quote) which should prevent the shell from interpreting the metacharacters in the quoted sequence except for $ (dollar sign).
  • Not interpret unclosed quotes or special characters which are not required by the
    subject such as \ (backslash) or ; (semicolon).
  • Handle environment variables ($ followed by a sequence of characters) which
    should expand to their values.

man

Here Documents
This type of redirection instructs the shell to read input from the current source until a line containing only
word (with no trailing blanks) is seen. All of the lines read up to that point are then used as the standard
input for a command.
The format of here-documents is:

<<[−]word
here-document
delimiter

No parameter expansion, command substitution, arithmetic expansion, or pathname expansion is performed
on word. If any characters in word are quoted, the delimiter is the result of quote removal on word, and
the lines in the here-document are not expanded. If word is unquoted, all lines of the here-document are
subjected to parameter expansion, command substitution, and arithmetic expansion. In the latter case, the
character sequence \<newline> is ignored, and \ must be used to quote the characters \, $, and ‘.
If the redirection operator is <<−, then all leading tab characters are stripped from input lines and the line
containing delimiter. This allows here-documents within shell scripts to be indented in a natural fashion.

資料

Arithmetic Expansion: https://www.gnu.org/software/bash/manual/html_node/Arithmetic-Expansion.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.