printf and make
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > printf and make




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    printf and make  
Billy Patton


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-30-04 04:34 AM

In my make file I do

printf "$keep the dollar\n" > somefile

I've tried to do \$ $$ {$} but make still tries to sub the $

How can I prevent this?

I'm using GNU Make version 3.79.1
Built for sparc-sun-solaris2.7
But I'm running on sol8

___  _ ____       ___       __  __
/ _ )(_) / /_ __  / _ \___ _/ /_/ /____  ___
/ _  / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/   \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodlogy Group
Dallas, Texas, 214-480-4455,  b-patton@ti.com





[ Post a follow-up to this message ]



    Re: printf and make  
examnotes


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-30-04 04:34 AM

Billy Patton <bpatton@bright.dal.design.ti.com> writes:
quote:
> In my make file I do > > printf "$keep the dollar\n" > somefile > > I've tried to do \$ $$ {$} but make still tries to sub the $ > > How can I prevent this?
$$ is the proper way to do it in the makefile. I suppose you want the shell to expand the variable. Is that correct? -- Måns Rullgård mru@kth.se




[ Post a follow-up to this message ]



    Re: printf and make  
Jens Schweikhardt


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-30-04 06:36 AM

Billy Patton <bpatton@bright.dal.design.ti.com> wrote
in <Pine.GSO.4.58.0401300613200.22515@bright.dal.design.ti.com>:
# In my make file I do
#
# printf "$keep the dollar\n" > somefile
#
# I've tried to do \$ $$ {$} but make still tries to sub the $

If you want the $ end up in somefile, use

printf "\$$keep the dollar\n" > somefile

The shell will then see printf "\$keep the dollars\n" > somefile
You could as well use

printf '$$keep the dollar\n' > somefile



Regards,

Jens
--
Jens Schweikhardt  http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:57 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register