Pure POSIX shell scripting...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Pure POSIX shell scripting...
# 1  
Old 08-26-2016
Pure POSIX shell scripting...

Hi all...

This is more of a concensus question than help...

As many of you know I am experimenting with the limitations of Pure POSIX shell scripting.

Q: Is the directory /bin considered part of the Pure POSIX shell or must I stick entirely with the builtins only?

The reason is I would really like to use cat for binary transfer but this is not a builtin but in the '/bin' directory.
The command dd would be useful too.

Comments?
# 2  
Old 08-26-2016
There is no requirement in the standards saying that utilities found in /bin conform to the standard. The only files that the POSIX standards require to be at a specific location are /, /dev, /dev/console, /dev/null, /dev/tty, and /tmp.

The 2nd example in the EXAMPLES section on the POSIX command utility man page shows you how to start a POSIX script that will use the "standard" utilities when referenced by name assuming that you are running a POSIX conforming shell. And, if you can find a POSIX conforming command utility (note that command is almost always a shell built-in in a standards conforming shell, but there must also be a standalone command utility) the command:
Code:
command -pv standard_utility_name

will give you the pathname on your system of a POSIX conforming version of the utility named standard_utility_name in any shell.
These 2 Users Gave Thanks to Don Cragun For This Post:
# 3  
Old 08-26-2016
Thank you Don...

As ever your knowledge of the shell is beyond reproach.
Will read the man page later today...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. OS X (Apple)

Generate a random number in a fully POSIX compliant shell, 'dash'...

Hi all... Apologies for any typos, etc... This took a while but it didn't beat me... Although there are many methods of generating random numbers in a POSIX shell this uses integer maths and a simple C source to create an executable to get epoch to microseconds accuracy if it is needed. I take... (8 Replies)
Discussion started by: wisecracker
8 Replies

2. Shell Programming and Scripting

Q: Is SQRT(n) possible in a POSIX compliant shell? A: Yes within limits.

Hi all... This is just a fun project to see if it is possible to get a square root of a positive integer from 1 to 9200000 to 6 decimal places on a 64 bit architecture machine. It is coded around dash and the results show the values from 0 to 10000. Complex numbers can easily be catered for by... (3 Replies)
Discussion started by: wisecracker
3 Replies

3. Shell Programming and Scripting

Equivalent to let command in POSIX shell

Hi all, I am learning POSIX shell programming, and the book I read, uses the let command for integer arithmetic. I have downloaded and use the shellcheck program on Linux. This programs says: In POSIX sh, 'let' is undefined. See the screenshot attached. What is the POSIX... (1 Reply)
Discussion started by: johnprogrammer
1 Replies

4. What is on Your Mind?

Popularity-Boost for the POSIX-Shell in the Era of Containerized Computing?

Not even thinking that POSIX-Shell is deprecated, but I like working with bash very much, because of it's increased comfort and advanced functions. And in my world here it's available everywhere as default. Working with kubernetes now, it seems there is a paradigm shift in terms of resources.... (1 Reply)
Discussion started by: stomp
1 Replies

5. Shell Programming and Scripting

Is Rule 7 of POSIX shell grammar rules written correctly?

The POSIX shell standard grammar rules are at Shell Command Language I am trying to understand Rule 7 and I don't. I think there may be some mistakes there. I am not complaining about the standard; rather, I am concerned that my perception is wrong, and I don't understand something important.... (3 Replies)
Discussion started by: Mark_Galeck
3 Replies

6. Shell Programming and Scripting

Logical expression in POSIX compliant Korn Shell

Hi, i want to check if a variable var1 is not a or b or c pseudo code: If NOT (var1 = a or var1 = b or var1 = c) then ... fi I want to use POSIX complaint Korn shell, and for string comparison For the following code, logical.sh #!/usr/bin/ksh var="j" echo "Var : $var" if ! { || ||... (12 Replies)
Discussion started by: ysrini
12 Replies

7. Shell Programming and Scripting

insert spaces between characters with pure shell

A file contains: abcdef I need : a b c d e f It's easy with sed sed 's/./& /g'but this is embedded linux that doesn't have sed/awk. The shell is unknown but it's bashlike. Parameter expansion works and seems promising and. A question mark seems to work as a wildcard, but there doesn't seem... (5 Replies)
Discussion started by: fubaya
5 Replies

8. What is on Your Mind?

Shell scripting vs Perl scripting

Hi all, I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first. Can you please help me determine which one to... (14 Replies)
Discussion started by: Pouchie1
14 Replies

9. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

10. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies
Login or Register to Ask a Question