[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to debug shell cmds?
From: |
Jens Schweikhardt |
Subject: |
Re: How to debug shell cmds? |
Date: |
Wed, 29 Jan 2003 10:47:34 +0100 |
User-agent: |
Mutt/1.4i |
On Wed, Jan 29, 2003 at 10:17:50AM +0100, Dusan Juhas wrote:
...
# Sorry. That sometimes happens when I do more that one thing at once ;-)
# I mean - what to do if I want to stop 'make' everytime a shell cmd
# is invoked?
#
# Eg:
# ...
# ifeq ($(PROF), on)
# DEFINES += -DKERNEL_PROF
# endif
# $(STRIP) -o target $(TARGETOUT)
# ...
#
# Well, now it seems that first 3 lines are make commands and 4th line
# is shell cmd. But is there any option/way to tell 'make' to do
# a certain action before (or after) invoking any shell cmd?
Yes. You change the SHELL make variable and then invoke debugsh
doing whatever you want and then runs the actual shell command. Tested:
$ cat Makefile
all:
@echo foo
@ls Makefile debugsh 2>/dev/null || true
$ cat debugsh
#!/bin/sh
echo '===> Type Enter to execute sh' "$@"
read dummy
exec sh "$@"
$ chmod 755 debugsh
$ gmake
foo
Makefile debugsh
$ gmake SHELL=debugsh
===> Type Enter to execute sh -c echo foo
foo
===> Type Enter to execute sh -c ls Makefile debugsh 2>/dev/null || true
Makefile debugsh
Regards,
Jens
--
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)
Re: How to debug shell cmds?, Paul D. Smith, 2003/01/29