What happens when we use >> for redirection. This operator opens the files in append mode and hence there are no issues due to overwriting values.
But try this:
#!/bin/bash
exec >>foo 2>>&1
echo hello >&1
echo boss >&2
Try making it this way:
#!/bin/bash
exec >>foo 2>>1
echo hello >&1
echo boss >&2
Now you see that the file 1 is created with the text boss. So, the bottomline is >> cannot be used with &.
Hope this helps.
Rgds,
Karthick S.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment