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

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

 



Title: Re: How to check the number of terminals open from inside a shell script
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
fi

Check the lifecycle of the environment variable is what you need though.

Mark



On 29/10/2010 12:26, "sumatheja" <sumatheja@xxxxxxxxx> wrote:

Hi All,
        I'm can anyone let me know if there's some variable holding
the value of the total number of terminals open. I have a requirement
where i need to execute some script only first time a terminal is
opened. I feel this is not the right place to post this but will be
glad if someone can help me out.

--
cheers
Sumatheja Dasararaju
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux