fork download
  1. #!/bin/bash
  2.  
  3. # ideone boilerplate: run in temp dir
  4. t=$(mktemp -d -t ideone.XXXXXXXX) || exit
  5. trap 'rm -rf "$t"' ERR EXIT
  6. cd "$t"
  7.  
  8. tr _ '\t' <<\____ >Makefile
  9. # $Id: //repository/path/check.make#6 $
  10. str1 := $(shell sed '/[$$]Id:/!d;s/^\# //' Makefile)
  11.  
  12. .PHONY: all
  13. all:
  14. _echo 'str1 "$(str1)"'
  15. ____
  16.  
  17. make --version
  18.  
  19. make
Success #stdin #stdout 0s 4476KB
stdin
Standard input is empty
stdout
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://g...content-available-to-author-only...u.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
echo 'str1 "$Id: //repository/path/check.make#6 $"'
str1 "$Id: //repository/path/check.make#6 $"