Advertisement
Guest User

Untitled

a guest
Mar 29th, 2024
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.23 KB | None | 0 0
  1. echo "hello 1"
  2.  
  3. exec 3>&1  # Open FD 3 as a duplicate of stdout (fd 1)
  4. # Run ./build.sh but make sure it does not have FD 3 open and tee to FD 3
  5. VARIABLE=$(echo "hello 2" 3>&- | tee /dev/fd/3)
  6. exec 3>&-  # Close FD 3
  7.  
  8. echo "hello 3"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement