Re: getdate(3) - format date

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2006-09-26 at 19:27 +0200, HIToC wrote:
> Hello Henry,
> 
> 	I have used "sh": sh script
> But using ./script has the same problem: DATEMSK is not exported.
> 
> Thank you for the emails
> HIToC
> 

If you execute a script via sh script.sh or ./script.sh it is executed
in a sub shell. So every exported variable is only set in all sub-sub
shells.

Try this script to see what I mean

#!/bin/sh

export V=Test
echo $V



Now execute it in a sub shell:

sh script.sh
echo $V

and execute it in the current shell (via sourcing it)

. ./script.sh
echo $V

or

source script.sh
echo $V



Best regards,

Henry

-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux