LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-24-2022, 12:23 PM   #16
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 2,983

Rep: Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120

Quote:
Originally Posted by Mobianuser View Post
I will check it but I am inside city for the weekend an I need to go country side to better get a gps fix
Not sure if this is still an issue, but for testing purposes perhaps you can replace your GPS program with something that reads an existing data file and pauses between outputting each line, e.g:
Code:
$ cat ./slow-print.sh
#!/bin/bash

while IFS= read -r line; do
    printf '%s\n' "$line";
    sleep 0.5;
done < "$1"

$ ./slow-print.sh sample-data.txt
 
Old 10-24-2022, 04:56 PM   #17
Mobianuser
LQ Newbie
 
Registered: Oct 2022
Posts: 8

Original Poster
Rep: Reputation: 0
Something like
/Code
while not grep -iw "longitude" sudo mmcli m --location-get
Do
sudo mmcli m --location-get
Else
Get longitud value
Done
/Code
This is the idea but zI o it thinkis well coded
 
Old 10-30-2022, 01:31 PM   #18
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,139

Rep: Reputation: 953Reputation: 953Reputation: 953Reputation: 953Reputation: 953Reputation: 953Reputation: 953Reputation: 953
Something like this:
Code:
longitude= altitude=
while
  read -r line &&
  [ -z "$longitude" -o -z "$altitude" ]
do
  case $line in
  ( *longitude* )
    longitude=$line
  ;;
  ( *altitude* )
    altitude=$line
  esac
done < <( command_to_process )
printf "%s\n" "$longitude" "$altitude"
This runs the "command_to_process" once,
and reads its output until longitude and altitude occurs.

The alternative is to run a command many times, each time checking if the expected output occurs.

Last edited by MadeInGermany; 10-30-2022 at 01:44 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and replace string ina file with specific condition pradeepspa Linux - Newbie 4 01-30-2017 04:09 PM
check Negative egrep condition in an if condition novicunix Programming 5 02-02-2013 01:52 AM
.htaccess how to require authn for all files ina folder, besids certain file extentns pxshock Linux - Server 0 04-27-2008 07:40 PM
using OR condition in if condition Fond_of_Opensource Linux - Newbie 2 10-20-2006 01:34 AM
How to display multiple bmps one after the other ina window frmhero2zero Programming 2 10-04-2002 11:56 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration