Skip to content

han0x7300's blog

Sharing, progress, innovation.

  • Article List

Category: BASH

bookmark_borderHow import/not import variables when writing Here Document in Bash

Posted on October 28, 2023October 28, 2023 by hans

import variable:

Var1="linux"

su hans << EOF
echo $Var1
EOF

don’t import variables:

Var1="linux"

su hans << 'EOF'
echo $Var1
EOF

When quoting EOF, the scripts will not import variables.

Posted in BASHLeave a Comment on How import/not import variables when writing Here Document in Bash

Recent Posts

  • PHP Deserialization Lab: Developing a custom gadget chain for PHP deserialization June 12, 2025
  • Email Security May 18, 2024
  • I have obtained the OSWE certificate May 18, 2024
  • How import/not import variables when writing Here Document in Bash October 28, 2023
  • I have obtained the OSEP certificate October 5, 2023

Categories

  • biubiu (6)
  • Life (1)
  • Tech (47)
    • BASH (1)
    • Cert (2)
    • Config (2)
    • Disassemble (3)
    • Info Sec (1)
    • Java (11)
    • NetWork (3)
    • PHP (5)
    • PWN (1)
    • ShellCode (3)
    • SQL Server (1)
    • Web (7)
    • WIFI (1)
keyboard_arrow_up
Theme: Noto Simple