Search Results

Search: Posts Made By: orbit
Forum: Programming 01-04-2015
1,733
Posted By Don Cragun
One thing Bourne based shells and csh based...
One thing Bourne based shells and csh based shells share is that $? is the exit code of the previous command. But, we're talking about a UNIX Version 6 shell here; not a modern shell. I never used...
Forum: Programming 01-04-2015
1,733
Posted By achenle
Without any comments from the programmer stating...
Without any comments from the programmer stating the intent of the code, it's impossible to tell.


Depending on your command shell, it's usually something like this:
-bash-4.1$ command arg1 arg2...
Forum: Programming 01-04-2015
1,733
Posted By ongoto
That is possible. I can't remember all the type...
That is possible. I can't remember all the type checking details used in those days either. One way Bash (nowadays) distinguises between a variable named 'func' and a function named 'func()' is the...
Forum: Programming 01-04-2015
1,733
Posted By achenle
The more I think about it, the less sure I am...
The more I think about it, the less sure I am about that. As K&R C treats pretty much all functions as variable-argument, how could the compiler know what you meant? There's no way for a compiler...
Forum: Programming 01-04-2015
1,733
Posted By Don Cragun
If you look closely, I think you'll find that...
If you look closely, I think you'll find that that is "if { command }" (with no expr); the exit status of command, in this case, is the expression.

ongoto already explained most of what is going...
Forum: Programming 01-04-2015
1,733
Posted By ongoto
Part of an if statement can be to call (fork) an...
Part of an if statement can be to call (fork) an external function; e.g. sed. You could say a == (the results of) sed /something/ for example. ccode is just the name of a variable. Judging by the...
Forum: Programming 01-01-2015
1,733
Posted By achenle
The source code is old K&R C, without function...
The source code is old K&R C, without function declarations.

Don't write code like that, and don't ever modify old K&R C by adding function declarations - unless you like getting into the...
Forum: Programming 12-31-2014
1,733
Posted By ongoto
I meant no offense. I'm just going along with...
I meant no offense.
I'm just going along with what you said. The questions you raised supports the fact that it doesn't make any sense, right?

if (exp()) is asking if the function exists; it's...
5,724
Posted By Don Cragun
@4: If goto was a built-in in the shell, the...
@4: If goto was a built-in in the shell, the shell might be able to find the labels in the script it was executing (and would be able to handle goto in an interactive shell) instead of needing to...
5,724
Posted By Scrutinizer
@1: By typing commands on the command line and...
@1: By typing commands on the command line and executing them by using "enter".
@2: The man pages does not seem to specify whether or not spaces can be used, but I would just control the urge to use...
5,724
Posted By Don Cragun
You can find a man page for : in the Man Pages...
You can find a man page for : in the Man Pages section on this forum here: colon(1P) (https://www.unix.com/man-page/posix/1/colon/)
5,724
Posted By Perderabo
The Thompson goto command was bizarre because it...
The Thompson goto command was bizarre because it was not a shell built-in. It was actually an external command. Decisions like this were made to get the thing to run in a 16 bit machine.

First...
5,724
Posted By Scrutinizer
This seems to me is referring to the historical...
This seems to me is referring to the historical Thompson shell (http://v6shell.org/man/osh.1.html) (Its successor Bourne Shell in UNIX v7 did not have a goto...)

1.
I think it means that you...
Showing results 1 to 13 of 13

 

Featured Tech Videos

All times are GMT -4. The time now is 07:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy