Can I view Bash POSIX extensions?

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Can I view Bash POSIX extensions?
# 1  
Old 01-13-2018
Can I view Bash POSIX extensions?

Hello.. and thanks in advance for any help anyone can offer me to figure this out

I'm reading about the about the Bash shell... and I've read from many sources that to make Bash POSIX compliant it needs "extensions"... Which sounds to me like something I should be able to load or unload into Bash... I've tried googling the subject but can't seem to find any detail about this subject... What little I can find basically says nothing more than "Bash needs extensions"

Is there a way I can view the extensions Bash is loading? Load or unload them? Configure them differently?

Once again... thanks for any help!
# 2  
Old 01-13-2018
Code:
#!/bin/bash --posix   # puts bash in POSIX mode

Note: bash in POSIX mode is not 100% POSIX guaranteed. It is really close.

The extensions are innate to bash. You do nothing special to make them switch on. You have to be aware of what ways turn them on, turn them off.

So you cannot view them. You may not know this, but you can add your own code and make it part of bash as well. This is not recommended because every upgrade/bugfix means you have to add your change back in.

Code:
#!/bin/bash

on the first line of the script invokes native bash. NOT POSIX.
Code:
#!/bin/sh

on the first line of the script invokes bash in POSIX mode. If /bin/sh is a symlink that points to bash

See: Difference between sh and bash * GitHub

Want to add bash extensions of your own? - examples:
http://cfajohnson.com/shell/date-fun...e-functions-sh
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

Moving from Desktop View to Mobile View

See attached video for a demo on how to move back and forth from the desktop view to the mobile view. Currently this only works for the home page, but I will work on some new PHP code in the future to make this work with the page we are currently on. Edit: The issue with making every page ... (2 Replies)
Discussion started by: Neo
2 Replies

2. OS X (Apple)

POSIX compliance...

Thanks to all you guys about posix compliance I have learnt an enormous amount over the last few days. I have written a program that is an Egg Timer with simple animation. I now realise how sophisticated 'bash' is compared to full posix compliance. The code below has passed all of the tests from... (11 Replies)
Discussion started by: wisecracker
11 Replies

3. Shell Programming and Scripting

Ls without extensions.

Hello everyone. :) I need to write a script and I'm newbie in it. Sorry for my English, I've been learning that amazing language for one year. Task: Write script called 'myls', "wrapper" program call ls in such a way that you could ask it the name of the file without extension, for example:... (1 Reply)
Discussion started by: Sweetheart
1 Replies

4. UNIX Desktop Questions & Answers

Appending file extensions to filenames in bash scripts

Hi Suppose I have a variable called filename and it it contains the name of a file. I then would like to append an extension to that filename. The filename currently has no extensions. How do I do this? Thanks (11 Replies)
Discussion started by: ladyAnne
11 Replies

5. Programming

ResumeThread on POSIX

Hi all How i can create thread in SUSPENDED mode, and resume when i want. I have win code with CreateThread (parameter CREATE_SUSPEND), and Resume Thread, but on POSIX with pthread i cant do it. Please help me. Best regards // Kolesar (5 Replies)
Discussion started by: Kolesar
5 Replies

6. Programming

Posix

HI, When i am configuring php in SUN Solaris. I am getting the below error. configure: error: Your system seems to lack POSIX threads. Do i need to install POSIX? If so can somebody let me know where can i download POSIX for Solaris 8? Thanks, (2 Replies)
Discussion started by: Krrishv
2 Replies

7. UNIX for Dummies Questions & Answers

how to read POSIX?

how to read POSIX? poe six or not? (3 Replies)
Discussion started by: robin.zhu
3 Replies

8. UNIX for Dummies Questions & Answers

extensions

Hey! Do you guys know of a good site that can explain all the Unix commands... I have been using Unix för almost 6 months but still have probelms with things like -u -U -g -G -R -T bla bla bla bla thanks! Dave (3 Replies)
Discussion started by: inkastinka
3 Replies

9. BSD

Posix queues

Hi! Everybody%) I got a question like this: Does my FreeBSD5.1 support Posix queues. Thanks! (7 Replies)
Discussion started by: kamazi
7 Replies

10. UNIX for Dummies Questions & Answers

.gz extensions

What do I use to open a file with a .gz extension? I'm guessing I need some kind of "unzipping" tool. (1 Reply)
Discussion started by: flopper
1 Replies
Login or Register to Ask a Question