Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Online / Offline Status Notification System via push

    Scheduled Pinned Locked Moved Development
    103 Posts 7 Posters 56.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      alexus
      last edited by

      grep makes me crazy reading the file!!!! Why the thingy doesnt work?

      Im getting "World: not found"

      
      USERNAME=grep 'World' /usr/local/StatusNotifier/var/status_notifier_conf.php; 
      echo "Username: $USERNAME";
      
      

      And here is the content of the file:

      
      	$lrc_box_name = "";
      	$lrc_box_location = "Bk";
      	$lrc_box_comments = "Main Test Site on Wall";
      // Hello World this is a test of grep file serach 
      	?>
      
      

      Any Ideas why it doesnt work?

      1 Reply Last reply Reply Quote 0
      • S
        sullrich
        last edited by

        @alexus:

        grep makes me crazy reading the file!!!! Why the thingy doesnt work?

        Im getting "World: not found"

        
        USERNAME=grep 'World' /usr/local/StatusNotifier/var/status_notifier_conf.php; 
        echo "Username: $USERNAME";
        
        

        And here is the content of the file:

        
        	$lrc_box_name = "";
        	$lrc_box_location = "Bk";
        	$lrc_box_comments = "Main Test Site on Wall";
        // Hello World this is a test of grep file serach 
        	?>
        
        

        Any Ideas why it doesnt work?

        Try

        
        USERNAME=`grep World /usr/local/StatusNotifier/var/status_notifier_conf.php`
        
        
        1 Reply Last reply Reply Quote 0
        • A
          alexus
          last edited by

          yay, it did work! Tnx
          I guess BSD treats quotations diferently from Linux too

          1 Reply Last reply Reply Quote 0
          • A
            alexus
            last edited by

            One more question:
            How can I strip begining and ending character of the string?
            Like I have username variable shrown as "username" (quotes are shown) and I want to strip out quotes

            1 Reply Last reply Reply Quote 0
            • S
              sullrich
              last edited by

              echo "'username'" | cut -d"'" -f2

              or

              echo '"username"' | cut -d'"' -f2

              1 Reply Last reply Reply Quote 0
              • A
                alexus
                last edited by

                other qute sign but I got the idea! thanks!
                now I have support of usernames in my script  :D

                1 Reply Last reply Reply Quote 0
                • S
                  sullrich
                  last edited by

                  @alexus:

                  other qute sign but I got the idea! thanks!
                  now I have support of usernames in my script  :D

                  Refresh

                  1 Reply Last reply Reply Quote 0
                  • A
                    alexus
                    last edited by

                    Refresh? what are u talking about?

                    1 Reply Last reply Reply Quote 0
                    • S
                      sullrich
                      last edited by

                      I modified my original post after you had already saw it.

                      1 Reply Last reply Reply Quote 0
                      • A
                        alexus
                        last edited by

                        lol yea, I look at it right away, almost all of the time :-P

                        1 Reply Last reply Reply Quote 0
                        • A
                          alexus
                          last edited by

                          Ok client side 100% Done, DNS-100%, Server Side  30%..
                          Im fealing lazy doing server side now, espesially login thingy, etc…  thatt might slow me down for some time

                          1 Reply Last reply Reply Quote 0
                          • S
                            sullrich
                            last edited by

                            You are on a roll.  Don't slow down ;)

                            1 Reply Last reply Reply Quote 0
                            • A
                              alexus
                              last edited by

                              I hate doing things that everty one else can do, thats like dirty work lol

                              1 Reply Last reply Reply Quote 0
                              • S
                                sullrich
                                last edited by

                                Part of the job description.

                                1 Reply Last reply Reply Quote 0
                                • A
                                  alexus
                                  last edited by

                                  not mine job description, aperantly im admin (not sysadmin) and not a programmer at all :-P

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    sullrich
                                    last edited by

                                    It became a part of your job description when you decided to become a programmer…

                                    1 Reply Last reply Reply Quote 0
                                    • A
                                      alexus
                                      last edited by

                                      me rogrammer? no way. I'm not a programmer :-P

                                      1 Reply Last reply Reply Quote 0
                                      • S
                                        sullrich
                                        last edited by

                                        Haha.. You are now.

                                        1 Reply Last reply Reply Quote 0
                                        • A
                                          alexus
                                          last edited by

                                          Oh yes  now im pfficially being declared as programmer by sullrich !
                                          So I want my salary raise too :-P

                                          1 Reply Last reply Reply Quote 0
                                          • S
                                            sullrich
                                            last edited by

                                            @alexus:

                                            Oh yes  now im pfficially being declared as programmer by sullrich !
                                            So I want my salary raise too :-P

                                            As soon as I get paid, the check will be in the mail :)

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.