So what does it do? Was RE: [SunHELP] What is this "sh -c true" u sed for?

Wyatt Draggoo wyatt at draggoo.com
Tue Jul 9 10:27:03 CDT 2002


>From what I can tell, `sh -c true' is used for compatibility reasons.  Not
all Unices have a `true' binary, but all will run `sh -c true' without
problems.

The reason there are so many in the Perl install script is because it's
generated on the fly.  In most Perl install scipts (that I've seen,
anyway), `sh -c true' is used for $NOOP, as in no operation, or don't do
anything.  If, for that particular part of the install, no action is needed
(the file might not be relavant on your platform, etc.) it adds $NOOP, or
`sh -c true' into the install script.  So, for each `sh -c true' line,
there was a part of the install which wasn't relavant to your platform for
some reason.

Wyatt

>
> Hi All,
>
> Looks like no one seems to know what those "sh -c true" are for.
> Its not really a problem. I am just curious !  and its bugging me !!
>
> I looked around the internet and there are lots of scripts that
> have these "sh -c true" calls in them. They all seem to be related
> to perl module installs.
>
> Any ideas as to where else I can look!
>
> TW
>
>
>
> -----Original Message-----
> From: DAUBIGNE Sebastien - BOR ( SDaubigne at bordeaux-bersol.sema.slb.com
> ) [mailto:SDaubigne at bordeaux-bersol.sema.slb.com]
> Sent: Thursday, 4 July 2002 9:27 PM
> To: Sun Help
> Subject: RE: [SunHELP] What is this "sh -c true" used for?
>
>
> "True" is a bourne-shell script that does nothing (see /usr/bin/true).
> Its purpose is to return a no-error code (0).
>
> I don't understand what is "sh -c true" made for.
> ---
> Sebastien DAUBIGNE
> sdaubigne at bordeaux-bersol.sema.slb.com <mailto:sebastien.daubigne at sema.fr>
> - (+33)5.57.26.56.36
> SchlumbergerSema - SGS/DWH/Pessac
>
>
> 	-----Message d'origine-----
> 	De:	Foong, Tzeweng [SMTP:Tzeweng.Foong at team.telstra.com]
> 	Date:	jeudi 4 juillet 2002 10:30
> 	:	Sun Help
> 	Objet:	[SunHELP] What is this "sh -c true" used for?
>
> 	Hello all,
>
> 	I had a peep into a shell script and I did not understand it!.
> 	Hope you guys can shed some light on what it is doing. The
> 	shell script installs some perl modules. but, I am not
> 	understanding what those "/bin/sh -c true" lines do?
>
> 	Please enlighten me!!
>
> 	Attached below are the first few lines from the shell script.
> 	-----------------------------------------
> 	/bin/sh -c true
> 	/bin/sh -c true
> 	/bin/sh -c true
> 	/usr/bin/perl -I/usr/perl5/5.00503/sun4-solaris -I/usr/perl5/5.00503
> \
> 		-MExtUtils::MakeMaker=Version_check \
> 		-e "Version_check('5.4302')"
> 	/bin/sh -c true
> 	/bin/sh -c true
> 	/bin/sh -c true
> 	/bin/sh -c true
> 	/bin/sh -c true
> 	/bin/sh -c true
> 	/usr/bin/perl -we '%m=@ARGV;for (keys %m){'  -e 'next if -e $m{$_}
> && -M
> 	$m{$_} < -M $_ && -M $m{$_} < -M "Makefile";'  -e 'print "Manifying
> 	$m{$_}\n";'  -e 'system(qq[$^X
> ].q["-I/usr/perl5/5.00503/sun4-solaris"
> 	"-I/usr/perl5/5.00503" /usr/local/bin/pod2man ].qq[$_>$m{$_}])==0 or
> warn
> 	"Couldn\047t install $m{$_}\n";'  -e 'chmod(oct(644)), $m{$_} or
> warn "chmod
> 	644 $m{$_}: $!\n";}' \
> 	Parser.pm \
> 	blib/man3/HTML::Parser.3 \
> 	lib/HTML/Entities.pm \
> 	blib/man3/HTML::Entities.3 \
> 	lib/HTML/Filter.pm \
> 	blib/man3/HTML::Filter.3 \
> 	lib/HTML/HeadParser.pm \
> 	blib/man3/HTML::HeadParser.3 \
> 	lib/HTML/TokeParser.pm \
> 	blib/man3/HTML::TokeParser.3 \
> 	lib/HTML/LinkExtor.pm \
> 	blib/man3/HTML::LinkExtor.3
> 	/bin/sh -c true
> 	vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> 	_______________________________________________
> 	SunHELP maillist  -  SunHELP at sunhelp.org
> 	http://www.sunhelp.org/mailman/listinfo/sunhelp
> _______________________________________________
> SunHELP maillist  -  SunHELP at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/sunhelp
> _______________________________________________
> SunHELP maillist  -  SunHELP at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/sunhelp

--
Wyatt Draggoo



More information about the SunHELP mailing list