LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 11:23 AM   #16
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,723

Rep: Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631Reputation: 2631

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, 03: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, 12:31 PM   #18
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Distribution: Mint/MATE
Posts: 2,928

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
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 12: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 03:09 PM
check Negative egrep condition in an if condition novicunix Programming 5 02-02-2013 12:52 AM
.htaccess how to require authn for all files ina folder, besids certain file extentns pxshock Linux - Server 0 04-27-2008 06:40 PM
using OR condition in if condition Fond_of_Opensource Linux - Newbie 2 10-20-2006 12:34 AM
How to display multiple bmps one after the other ina window frmhero2zero Programming 2 10-04-2002 10:56 AM

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

All times are GMT -5. The time now is 11:48 AM.

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