Showing input and output together on the shell
How to pipe a file information and bringing it to screen on the same time?
For example I tried out some demos in Swift. Swift exists as compiler ("swiftc") and as interactive shell ("swift"). And as interactive shell also as interpreter. If I start it as interactive shell, it looks like the fowllowing example Code:
$ swift This interactive shell is nice, but some examples are very long. But luckyly, they existing all as swift-files. This one looks like Code:
$ cat Example.swift Code:
$ swiftc Example.swift Code:
$ swift Example.swift With Code:
$ swift < Example.swift Code:
$ cat Example.swift | Example.swift So is it possible, to show the parts of the file and the output and the additional information output all together on the screen in the chronological order? Greetings theuserbl |
Code:
Fn='Example.swf' |
Quote:
But as I said, with » swift "$Fn" « are some parts missing. A » swift < "$Fn" « Is better. And a » cat "$Fn" && swift < "$Fn" « would output all, but not in the chronological order like in the top of the last posting. Or to show it you. This is how a » cat "$Fn" && swift < "$Fn" « looks like Code:
// Create arrays But like this I want to see it, that it looks like: Code:
Welcome to Swift version 5.3 (swift-5.3-RELEASE). theuserbl |
I assume you are using a typical desktop distribution. Open the file in a text editor and use the terminal to compile/run your program. Be sure to save changes or they will not be seen from swift. With this method you do not need to run interactive mode.
|
All times are GMT -5. The time now is 05:57 PM. |