Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2013
    Posts
    1

    Unanswered: {module::name.filetype} to _modules/name/application.filetype

    Code:
    path      = content.txt
    filename  = application
    directory = _modules
     
    define create
    	$(eval from := $(shell echo $$1)) \
    	$(eval to   := $(shell echo $$2)) \
    	sed -i '' 's/$(from)/$(to)/g' content.txt
    endef
     
    all:
    	clear
     
    	$(eval modules := $(shell egrep -o "{module[^ ]+\}" $(path)))
     
    	@for m in $(modules); do \
    		$(call create, $$m, \
    			$$m \
    			| sed 's/{module\([^ ]*\).*}/\1/' \
    			| sed 's/\./\/$(filename)\./g' \
    			| sed 's/\::/\$(directory)\//g' \
    		); \
    	done
    I'm getting this error:
    sed: first RE may not be empty

    I think the reason for it is because I can not use shell script inside of a for loop because $$1 is returning null.
    Anyone have any idea how to solve this issue?

  2. #2
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    Could you explain what it is you are trying to accomplish, and some sample input and output?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •