Yes. It is unfortunate POSIX doesn't include this ksh syntax. I also just noticed bash implements it a slightly different way, i.e. requires quotes where ksh doesn't.
As expected, other POSIX and non POSIX shells have various behaviors:
Interesting. This appears to apply to any redirect:
In bash this gives an ambiguous redirect
In ksh this works.
The bash version is more consistent with how things would usually work in shell, but IMO the ksh way is more logical in the sense that a variable reference can only ever mean one thing in this case, since a redirect to/from two files will never make sense (nor be allowed) anyway.
So I guess there is yet another reason to always use double quotes around a variable reference: portability.
Hello,
May be my post may look naive to many...but it isn't if you were to believe me.After, trying to learn programming in C for at least 5 years , I concluded that K & R is the best book to learn C, alas I took a lot of time to realize this.
So, I'm going to start learning how to program... (8 Replies)
Hello, I'm new to this forum, and I apologize in advance if I did something wrong here.
I am pretty stumped here as I am still getting the error message, "./comc1.sh: test: argument expected." after executing the script itself.
Here's the script file I modified:
I tried executing line 4... (1 Reply)
Hi is it me or is there a typo in the Sun Solaris man page for ps. I thought the option for listing a process by PID was just -p but on the clearcase server at work it reads: -
-ps proclist
Lists only process data whose process ID numbers are
given in proclist.... (5 Replies)
Hi
Sorry to post a bit of an "I'm an idiot" post, but I did a typing error and typed "ls 'l" instead of "ls -l". This seems to have made me enter some sort of mode or other that I can't seem to be able to get out of. The new line prompt is > (if that helps).
Sorry for posting such a... (1 Reply)
Hi everybody
I a new one
And I have just wanted to research on Sun Solaris
So can you help me what e-book to read ( and if can you give me the
direct address to load )
Thks so much (3 Replies)