LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   redirection question (https://www.linuxquestions.org/questions/linux-newbie-8/redirection-question-4175431146/)

penguinlover2 10-08-2012 10:41 AM

redirection question
 
Hi

I am reasonably familiar with the redirection syntax such as 2>&1
but recently I have come across a variant in a crontab that I cannot work out (googling and looking at bash developers guides hasn't helped either so far) it is this

00 12 * * * csh -c '/path/to/my/script.ksh >&! mylog.log

what does the >&! redirect do?

thanks

David the H. 10-08-2012 11:16 AM

Since the shell is csh, it's no wonder. The c-shell series is quite different in many ways from bourne-based ones like bash. It may be some kind of argument expansion or something.

What's really strange to me is that the person used csh in order to execute a ksh script. Why not just execute it directly?

And if he has ksh available, why isn't he using it instead, considering all the weaknesses the c-shell has?

penguinlover2 10-09-2012 07:27 AM

Quote:

Originally Posted by David the H. (Post 4800399)
Since the shell is csh, it's no wonder. The c-shell series is quite different in many ways from bourne-based ones like bash. It may be some kind of argument expansion or something.

What's really strange to me is that the person used csh in order to execute a ksh script. Why not just execute it directly?

And if he has ksh available, why isn't he using it instead, considering all the weaknesses the c-shell has?

thanks the csh pointer was the clue, its a form of csh redirection (which is different to bash),
for anyone else searching for this there is more reference on csh redirection here:

http://www.mathinfo.u-picardie.fr/as...direction.html

and the answer to my specific question is:
>&! means Redirect standard output and standard error; overwrite file if it exists

atb


All times are GMT -5. The time now is 10:30 AM.