How to check the number of terminals open from inside a shell script

Joachim Backess joachim.backes at rhrk.uni-kl.de
Fri Oct 29 15:26:24 UTC 2010


On 10/29/2010 03:39 PM, Mark Liggett wrote:
>  Hi Sumatheja,
> 
> I’m guessing you want a script to run only once (did say whether it was
> per user).  You could add your script to the .bashrc file – this way the
> script would run once when the user logs on.  Alternatively run the
> script and export an environment variable – then check it using an if
> statement before you run the script again, eg;
> 
> if [ -n “$script-has-run-envar” ]; then
>     <source_script>
>     script-has-run-envar=”Yes”
>     export $script-has-run-envar

I think you mean -without the $ char-  ;-)

      export script-has-run-envar

Regards


-- 
Joachim Backes <joachim.backes at rhrk.uni-kl.de>

http://www.rhrk.uni-kl.de/~backes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6131 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20101029/ae11d0ad/attachment.bin 


More information about the users mailing list