more info, more references
This commit is contained in:
		
							parent
							
								
									a682431d2e
								
							
						
					
					
						commit
						ecc3ad7cb6
					
				| @ -15,7 +15,7 @@ | |||||||
| <SCRIPT SRC="/js/sheets.js"  TYPE="application/javascript"></SCRIPT> | <SCRIPT SRC="/js/sheets.js"  TYPE="application/javascript"></SCRIPT> | ||||||
| <SCRIPT TYPE="application/javascript">window.onload = window.initializesheets;</SCRIPT> | <SCRIPT TYPE="application/javascript">window.onload = window.initializesheets;</SCRIPT> | ||||||
| <H1>POSIX true(1)</H1> | <H1>POSIX true(1)</H1> | ||||||
| <H3>updated 2021-08-06</H3> | <H3>updated 2021-08-18</H3> | ||||||
| <HR ALIGN="left" SIZE="1" WIDTH="25%" /> | <HR ALIGN="left" SIZE="1" WIDTH="25%" /> | ||||||
| <P> | <P> | ||||||
| <CODE>true(1)</CODE> is a tool that <I>only</I> quits silently with an exit status of 0. | <CODE>true(1)</CODE> is a tool that <I>only</I> quits silently with an exit status of 0. | ||||||
| @ -32,8 +32,8 @@ int main(void) { return 0; } | |||||||
| </CODE></PRE> | </CODE></PRE> | ||||||
| <P> | <P> | ||||||
| Because executing an empty shellscript file will in most shells do nothing and return an exit status of 0, technically an empty shellscript file is a POSIX-compliant <CODE>true(1)</CODE> implementation in 0 bytes. | Because executing an empty shellscript file will in most shells do nothing and return an exit status of 0, technically an empty shellscript file is a POSIX-compliant <CODE>true(1)</CODE> implementation in 0 bytes. | ||||||
| However (<B>TODO</B>) it's to me unknown whether this is implementation-specific or POSIX-specified. | This was the <CODE>true(1)</CODE> implementation on early versions of UNIX, including Research UNIX, System V, and Sun's Solaris, according to both Rob Pike and John Chambers. | ||||||
| The <I>usual</I> implementation in POSIX shell is also a one-liner if you ignore the shebang: | A more explicit implementation also exists in POSIX shell: | ||||||
| </P> | </P> | ||||||
| <PRE><CODE CLASS="language-shell" DATA-LANG="shell"> | <PRE><CODE CLASS="language-shell" DATA-LANG="shell"> | ||||||
| #!/bin/sh | #!/bin/sh | ||||||
| @ -60,8 +60,10 @@ Their <CODE>true.c</CODE> is 2.3 kilobytes, parses the arguments <CODE>--help</C | |||||||
| The GNU coreutils implementation of <CODE>true(1)</CODE> is not POSIX compliant. | The GNU coreutils implementation of <CODE>true(1)</CODE> is not POSIX compliant. | ||||||
| </P> | </P> | ||||||
| <H2>Cited media and further reading</H2><UL> | <H2>Cited media and further reading</H2><UL> | ||||||
| 	<LI>Articles<UL> | 	<LI>Articles and posts<UL> | ||||||
| 		<LI><A HREF="https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html">Brian Raiter - A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux</A></LI> | 		<LI><A HREF="http://trillian.mit.edu/~jc/;-)/ATT_Copyright_true.html">CHAMBERS John - The /bin/true Command and Copyright</A></LI> | ||||||
|  | 		<LI><A HREF="https://twitter.com/rob_pike/status/966896123548872705">PIKE Rob - "/bin/true used to be an empty file."</A></LI> | ||||||
|  | 		<LI><A HREF="https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html">RAITER Brian - A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux</A></LI> | ||||||
| 	</UL></LI> | 	</UL></LI> | ||||||
| 	<LI>Manual pages<UL> | 	<LI>Manual pages<UL> | ||||||
| 		<LI><A HREF="https://www.unix.com/man-page/posix/1p/true/">true(1p)</A> (The Open Group, 2003)</LI> | 		<LI><A HREF="https://www.unix.com/man-page/posix/1p/true/">true(1p)</A> (The Open Group, 2003)</LI> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user