ksh equivalent to >& in csh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ksh equivalent to >& in csh
# 15  
Old 11-05-2010
Quote:
Originally Posted by jlliagre
Huh ?
Have you anything to support that bizarre (to say the least) HP-UX theory ?
I remember having used that notation years ago at outsourcing service division of HP (don't remember the HP-UX version nor the Hardware on which it was) ... Or is it my brain which is betraying me ... already alzeimer ???
(a long time i haven't use HPUX)
# 16  
Old 11-05-2010
If you used it on HPUX then that probably wasn't right. It is a quite common mistake, and often it does not get corrected, since the trouble is that it will only get noticed if there is an actual error message on stderr (and scripts do not always get tested properly). The only time one would use 2>&1 ... > is if stdout and stderr were pointing to different destinations before and you want to point stderr to where stdout is pointing before redirecting stdout to somewhere else.

Last edited by Scrutinizer; 11-05-2010 at 05:31 AM..
# 17  
Old 11-05-2010
I wasn't writting a script, i was fixing an existing script and the fix was to rewrite so.

So maybe it is my brain : i don't remember the exact context ... maybe the context was : an error unexpectedly logged into a log file ...

Oooops - good morning ! Smilie
# 18  
Old 11-05-2010
Quote:
Originally Posted by ctsgnb
I remember having used that notation years ago at outsourcing service division of HP (don't remember the HP-UX version nor the Hardware on which it was) ... Or is it my brain which is betraying me ... already alzeimer ???
That would be the latter, welcome to the club Smilie
HP, like most others Unix vendors, is using System V ksh88 code (likely with custom patches). This code is processing the redirections in order they are found, like the traditional bourne shell, bash and all POSIX (more or less) compliant shells. Open Group: Shell Command Language (Redirections)
There is absolutely no reason for this standard way to be deliberately broken.
HP-UX: Command Separators
# 19  
Old 11-05-2010
@jilliagre
Yep, i think i used it in a very specific context : the redirection were for sure working just the standard way. I guess it is just the expected result for that specific need that made me use the 2>&1 before, and it was so unusual and so far in my souvenir, this is what brought the confusion in my too little brain lol Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

>& >&! in /bin/csh

i am new player in linux what does mean ">& and >&!" in script or command line? thanks (4 Replies)
Discussion started by: abdossamad2003
4 Replies

2. Shell Programming and Scripting

Expect : what is the equivalent to ksh if -s

In Ksh to check if file exists and is non zero .. if ; then echo "Error $FILE does not exists!" else echo "$FILE found!" fi Cant seem to find the Expect equivalent .... Any help is greatly appreciated. (2 Replies)
Discussion started by: popeye
2 Replies

3. Shell Programming and Scripting

Equivalent of set -o vi in csh

Hi, I am working with two shells on two different users. one is on ksh and one is on csh. In ksh I use set -o vi and I am able to see my history commands by typing esc,- keys. I want the same feature in csh as well how can I do that. Regards, Venkat (3 Replies)
Discussion started by: svenkatareddy
3 Replies

4. Shell Programming and Scripting

equivalent of backspace in ksh

Hello All, What would be the equivalent of backspace key in the korn shell. My scenario is: I am trying to install a product..and it comes out with a Licence Agreement screen, When I manually enter backspace key..I am able to get out of the whole agreement message to a point to type Agree A) or... (2 Replies)
Discussion started by: solaix14
2 Replies

5. Shell Programming and Scripting

How to define array in Bourne shell , csh & ksh

Dear friends... Kindly if any one can help me to know the differences in definning & retreiving data from arrays in the sh,csh & ksh. I always facing problems in this issue. thanks...:) BR (3 Replies)
Discussion started by: ahmad.diab
3 Replies

6. Shell Programming and Scripting

what is ksh equivalent of bash echo -n ?

Hi folks, I need to stop printing a new line after echoing a string in KSH. i know bash provides echo -n "string" what is the ksh equivalent for this ? (3 Replies)
Discussion started by: mudhireddy
3 Replies

7. UNIX for Dummies Questions & Answers

Csh Vs Ksh

I created a simple script and attempted to run it. All that the scrip contained was "ls -l". At first I received the message "ksh: run_dir: not found" I then tried typing "csh run_dir" This time the script worked. typing echo $SHELL produced /bin/ksh I would like to understand why this... (4 Replies)
Discussion started by: SUSANR9999
4 Replies

8. Shell Programming and Scripting

Exactly How can we define "sh ksh csh &bash"

Hi - I m prashant. I m new in UNIX&LINUX world. I want to ask that how can we define the shell in Linux like bash,ksh,csh in Linux. What is the use of these shells. I know there are mny experts on net if you can tell me then please do me this favour and tell me about this topic. ... (1 Reply)
Discussion started by: prashantsingh
1 Replies

9. Shell Programming and Scripting

\!* in csh what is it for ksh

Hey guys, Hopefully a simple question for you. In csh I have an alias that looks like: alias ff 'find . -name \!* -print' and can therefore perform a search for a file by typing: ff filename The same comand does not work in ksh alias ff="find . -name \!* -print" I get: find:... (3 Replies)
Discussion started by: timsk
3 Replies

10. Shell Programming and Scripting

Perl equivalent of ksh if / echo statement

Is there an equivalent perl statement for the following ksh statement ? example if then ... else ... fi (2 Replies)
Discussion started by: gefa
2 Replies
Login or Register to Ask a Question