Monday, June 13, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


wipefs + disk not cleaned

Posted: 13 Jun 2022 03:05 AM PDT

we erased the disk signature as the following ( this is after we performed umount )

 wipefs -a /dev/sde  /dev/sde: 2 bytes were erased at offset 0x00000438 (ext4): 53 ef  

then we check that disk is without file system as the following

lsblk -f    sde                ext4              20eba791-c9c9-4462-aa23-74c40a41b8a0     

but in spite we erase the filesystem , lsblk still show the ext4 filesystem on sde disk

Virtual keyboard and physical keyboard, but different languages

Posted: 13 Jun 2022 04:00 AM PDT

I'd like to have active, at the same time, a virtual keyboard (I have installed onboard) and the physical keyboard of my notebook, but with different languages, say Russian (virtual) and English (physical), because I'm not familiar with the Russian layout and I need to peek the right key by visual inspection.

Unfortunately, afaict onboard uses the same layout/language (l/l) as the physical keyboard (I know how to install different l/l's and how to switch between them) and what I'd like to do cannot be done.

I suspect this (only one l/l active at once) could be a limitation of X, so my question has a few facets…

  1. Is it possible to have two l/l active at the same time?
  2. If it is possible, how can I accomplish it using onboard?
  3. If onboard is unsuitable, is there a different virtual keyboard that provides this functionality?

Tia

Display - Burnt Borders

Posted: 13 Jun 2022 02:32 AM PDT

I use an oracle linux, and my borders of any window look like this when connecting through vnc. I tried changing all options in display settings and in tweak has but nothing has worked. It is very annoying, please help. Icons are also 'burnt' like this.

enter image description here

Multiple conditions in if statement

Posted: 13 Jun 2022 03:19 AM PDT

I am doing a basic question for adding, product, subsraction, division by taking user input in first and second I don't understand where am I going wrong because it's not passing any test case.

constraints:- -100<=x,y<=100, y != 0

read -p "enter first number:" first  read -p "enter second number:" second  if [[ ("$first" -ge "-100"  -a "$first" -ge "100") -a ("$second" -ge "-100" -a "$second" -ge "100") ]]  then      if [ $second -ne 0 ]      then              echo "$first + $second" | bc          echo "$first - $second" | bc          echo "$first * $second" | bc          echo "$first / $second" | bc      fi  fi  '''  

Merge multiple rows into single row then append to csv output file

Posted: 13 Jun 2022 04:10 AM PDT

I have multiple comma-separated files that I need first to merge the rows into a single row then I can append that row to append to one output.csv file.

file-1.txt:

CV-1999-0001,  CV-1999-0002,  CV-1999-0003,  CV-1999-0004,  CV-1999-0005,    ...  

file-2.txt:

CV-2000-0006,  CV-2000-0007,  CV-2000-0008,  ....  

output.csv:

IDs  CV-1999-0001,CV-1999-0002,CV-1999-0003,CV-1999-0004,CV-1999-0005  CV-2000-0006,CV-2000-0007,CV-2000-0008,CV-2000-0009,CV-2000-0010  

I have tried these but none seem to achieve what I need. I still end up with multiple rows

echo $(cat /Users/...../"$ROWS".txt) | sed 's/ //g' > "$ROWS_new".txt      echo $(cat paste -s -d "" files-1.txt) | sed 's/ //g' >> output.csv    

Optimize courier imap-ssl server configuration for large Emails

Posted: 13 Jun 2022 02:18 AM PDT

I use Courier with postfix on debian 11 and it all works fine, except, I cannot copy large emails into the IMAP Sent Folder.

I cannot find the richt configuration files and options, where I set the maximum email-size for Courier IMAP

How to get the value of a fixed width file by particular column line number in a straight line

Posted: 13 Jun 2022 01:20 AM PDT

I need to get the value in a file with certain line number without omitting the spaces and in existing format

eg.:

$ awk 'BEGIN{FS=OFS=""}{for(i=1;i<=18;i++) print $i }' line_garb.csv > skps  $ cat skps  H  G  S    N  Q    D  1  5    Q  5    2  0  2  2  

I need to get the output like HGS NQ D15 Q5 2022.

I need to update the value HGS NQ D15 Q5 2022 starting from column number 69 to 115. Could you please provide me the command?

Thanks

qemu-system-i386: Could not load snapshot for icount replay

Posted: 13 Jun 2022 12:46 AM PDT

I'd like to use QEMU for recording/replaying execution. However, the replaying does not work as described in the manual:

$ qemu-system-i386 \  -icount shift=auto,rr=record,rrfile=record.bin,rrsnapshot=snap1 \  -drive file=boot.qcow2,if=none,snapshot=on,id=img-direct \  -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay \  -device ide-hd,drive=img-blkreplay \  -net none  
$ qemu-system-i386 \  -icount shift=auto,rr=replay,rrfile=record.bin,rrsnapshot=snap1 \  -drive file=boot.qcow2,if=none,snapshot=on,id=img-direct \  -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay \  -device ide-hd,drive=img-blkreplay \  -net none  qemu-system-i386: Snapshot 'snap1' does not exist in one or more devices  qemu-system-i386: Could not load snapshot for icount replay  

Snapshots made with savevm xyz can not be found either.

How do I get replaying to work?

QEMU version: 7.0.0

FLAC encoders – any difference in output between the command-line tools?

Posted: 13 Jun 2022 01:55 AM PDT

I would like to know if there is any difference in the final output between the various command-line tools for encoding FLAC files, like ffmpeg, sox, the "official" flac etc. In some contexts, I have noticed that it's recommended to use flac over the others, but given that FLAC represents lossless encoding, am I correct in assuming that they should all produce identical output (given the same options)?

What are the detriments of not setting MSFTDATA flag when making a exFAT partition?

Posted: 13 Jun 2022 02:03 AM PDT

I have several external HDDs that I backup data to and occasionally plugin internally when I need access to the data.

I erased all partitions by making a new GPT partition table on the disk. I made a primary partition of type NTFS and then formatted as an exFAT partition:

parted mkpart primary NTFS 0% 100%  mkfs.exfat /dev/sdb1  

Now, I can plug this HDD into both my Unix desktop and Windows desktop and can access the files without issue.

However, I noticed that my Windows partitions have MSFTDATA flag set when viewed in parted (parted print all).

I haven't set this flag - will this become an issue later and will setting the flag cause issues accessing the data from Unix? What exactly does Windows (or Unix) use this flag for?

Why does libvirt-daemon-system have so many dependencies on Debian?

Posted: 13 Jun 2022 03:03 AM PDT

On my headless debian 11 (bullseye) server, when I attempt to install libvirt-daemon-system, apt threatens to basically install an entire graphical environment, including audio libraries and everything:

mic@micserver:~$ sudo apt install libvirt-daemon-system  Reading package lists... Done  Building dependency tree... Done  Reading state information... Done  The following additional packages will be installed:    adwaita-icon-theme alsa-topology-conf alsa-ucm-conf at-spi2-core augeas-lenses dbus-user-session dconf-gsettings-backend dconf-service fontconfig glib-networking glib-networking-common    glib-networking-services gsettings-desktop-schemas gstreamer1.0-libav gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-x gtk-update-icon-cache hicolor-icon-theme i965-va-driver    ibverbs-providers intel-media-va-driver ipxe-qemu jq libaa1 libaacs0 libasound2 libasound2-data libass9 libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libaugeas0 libavc1394-0    libavcodec58 libavfilter7 libavformat58 libavutil56 libbdplus0 libbluray2 libbrlapi0.8 libbs2b0 libcaca0 libcacard0 libcairo-gobject2 libcairo2 libcapstone4 libcdparanoia0 libchromaprint1 libcodec2-0.9    libcolord2 libdatrie1 libdaxctl1 libdconf1 libdrm-amdgpu1 libdrm-common libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libdv4 libdw1 libepoxy0 libexecs0 libfdt1 libflac8 libflite1 libfribidi0 libgbm1    libgdk-pixbuf-2.0-0 libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-common libgfortran5 libgl1 libgl1-mesa-dri libglapi-mesa libglvnd0 libglx-mesa0 libglx0 libgme0 libgraphite2-3 libgsm1 libgstreamer-plugins-base1.0-0    libgstreamer1.0-0 libgtk-3-0 libgtk-3-bin libgtk-3-common libgudev-1.0-0 libharfbuzz0b libibverbs1 libiec61883-0 libigdgmm11 libjack-jackd2-0 libjq1 libjson-glib-1.0-0 libjson-glib-1.0-common liblapack3    liblilv-0-0 libmfx1 libmp3lame0 libmpg123-0 libmysofa1 libndctl6 libnetcf1 libnl-route-3-200 libnorm1 libogg0 libopenmpt0 libopus0 liborc-0.4-0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libparted2    libpciaccess0 libpgm-5.3-0 libpixman-1-0 libpmem1 libpocketsphinx3 libpolkit-agent-1-0 libpolkit-gobject-1-0 libpostproc55 libproxy1v5 libpulse0 libquadmath0 librabbitmq4 libraw1394-11 librdmacm1    librest-0.7-0 librsvg2-2 librsvg2-common librubberband2 libsamplerate0 libserd-0-0 libshine3 libshout3 libslirp0 libsndfile1 libsord-0-0 libsoup-gnome2.4-1 libsoup2.4-1 libsoxr0 libspeex1 libsphinxbase3    libspice-server1 libsratom-0-0 libsrt1.4-gnutls libssh-gcrypt-4 libswresample3 libswscale5 libtag1v5 libtag1v5-vanilla libthai-data libthai0 libtheora0 libtwolame0 libudfread0 libunwind8 liburing1    libusbredirparser1 libv4l-0 libv4lconvert0 libva-drm2 libva-x11-2 libva2 libvdeplug2 libvdpau-va-gl1 libvdpau1 libvidstab1.1 libvirglrenderer1 libvirt-clients libvirt-daemon libvirt-daemon-config-network    libvirt-daemon-config-nwfilter libvirt-daemon-driver-lxc libvirt-daemon-driver-vbox libvirt-daemon-driver-xen libvisual-0.4-0 libvorbis0a libvorbisenc2 libvorbisfile3 libvpx6 libvte-2.91-0 libvte-2.91-common    libvulkan1 libwavpack1 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwayland-server0 libx11-xcb1 libx264-160 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-randr0 libxcb-render0    libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxcomposite1 libxcursor1 libxdamage1 libxencall1 libxendevicemodel1 libxenevtchn1 libxenforeignmemory1 libxengnttab1 libxenhypfs1 libxenmisc4.14 libxenstore3.0    libxentoolcore1 libxentoollog1 libxfixes3 libxinerama1 libxkbcommon0 libxml2-utils libxrandr2 libxshmfence1 libxv1 libxvidcore4 libxxf86vm1 libzmq5 libzvbi-common libzvbi0 mdevctl mesa-va-drivers    mesa-vdpau-drivers mesa-vulkan-drivers ocl-icd-libopencl1 ovmf parted pocketsphinx-en-us policykit-1 qemu-system-common qemu-system-data qemu-system-gui qemu-system-x86 qemu-utils seabios va-driver-all    vdpau-driver-all  

I don't understand where this is coming from, though. Looking at apt-cache dependencies, the package seems much more sane:

mic@micserver:~$ apt-cache depends libvirt-daemon-system  libvirt-daemon-system    Depends: adduser    Depends: gettext-base   |Depends: iptables    Depends: firewalld    Depends: libvirt-clients    Depends: libvirt-daemon    Depends: libvirt-daemon-config-network    Depends: libvirt-daemon-config-nwfilter   |Depends: libvirt-daemon-system-systemd    Depends: libvirt-daemon-system-sysv    Depends: logrotate    Depends: policykit-1   |Depends: debconf    Depends: <debconf-2.0>      cdebconf      debconf    Breaks: systemd-sysv    Recommends: dmidecode    Recommends: dnsmasq-base    Recommends: iproute2    Recommends: mdevctl    Recommends: parted    Suggests: apparmor    Suggests: auditd    Suggests: nfs-common    Suggests: open-iscsi    Suggests: pm-utils    Suggests: radvd    Suggests: systemd    Suggests: systemtap    Suggests: <zfsutils>  

Can these dependencies be avoided?

How do I tell whether an update will require an initramfs update?

Posted: 13 Jun 2022 01:09 AM PDT

Sometimes, when running sudo apt-get upgrade, towards the end there are lines like:

Processing triggers for initramfs-tools (0.133+deb10u1) ...  update-initramfs: Generating /boot/initrd.img-5.10.103-v7+  

How do you tell in advance if this is going to happen?

(The particular context I'm in is Raspberry Pi OS, but I believe this question is applicable to all Debian-based/apt-based OSes.)

How to get 'man gfind' when I enter 'man find'?

Posted: 13 Jun 2022 01:38 AM PDT

On my new-ish mac os/Darwin system, my find tool is an 11-year-old BSD version. I have used MacPorts to install a more current version: GNU's find, which MacPorts has named gfind, and placed in /opt/local/bin/. The aging Apple-supplied find remains in /usr/bin/find.

I need to retain the old version of find in the event that it's still used by the system, but I'd much prefer to enter find at the command line instead of gfind. Old habits and all of that...

I know I can run gfind when entering find by either creating a link in /opt/local/bin/ (it's before /usr/bin in my PATH), or by creating an alias in .zshrc. Both of these work fine. My problem is how to get man gfind when I enter man find - I've tried several versions of alias in .zshrc, but none have worked.

How do I get this to work? How do I get man gfind in my pager display when I enter man find at the command line?

How to add a global proxy in an interface configuration file (ifcfg...) on Red Hat 7

Posted: 13 Jun 2022 01:23 AM PDT

I want to add a proxy directly to the interface configuration file so that every application is going to internet through it. What paramters do I write in that file to add proxy information (IP, Port) ?

Below, The content of the configuration file of my network interface (I deleted IP addresses):

TYPE="Ethernet"  PROXY_METHOD="none"  BROWSER_ONLY="no"  BOOTPROTO="none"  DEFROUTE="yes"  IPV4_FAILURE_FATAL="no"  IPV6INIT="yes"  IPV6_AUTOCONF="yes"  IPV6_DEFROUTE="yes"  IPV6_FAILURE_FATAL="no"  IPV6_ADDR_GEN_MODE="stable-privacy"  NAME="ens192"  DEVICE="ens192"  ONBOOT="yes"  IPADDR="X.X.X.X"  PREFIX="24"  GATEWAY="X.X.X.X"  DNS1="X.X.X.X"  DNS2="X.X.X.X"  DOMAIN="X Y Z"  IPV6_PRIVACY="no"  ZONE=public  

When date and timedatectl?

Posted: 13 Jun 2022 03:31 AM PDT

About reporting and settings for date and time exists available the date and timedatectl commands - it according with the most common results available through the web. Practically both do the same.

So when for an explicit scenario(s) one would be mandatory over the other?

Debian LiveBuild: How to make the bootloader to directly boot to live?

Posted: 13 Jun 2022 03:49 AM PDT

I just start learning on using LiveBuild. I want it to boot directly in 'Live' mode, no other boot choice(s)

Here is my auto/config

#!/bin/sh    set -e    lb config noauto \      --mode debian \      --distribution buster \      --architectures i386 \      --linux-flavours 686-pae \      --debian-installer false \          --apt-recommends false \          --debootstrap-options "--variant=minbase" \          --firmware-chroot false \      --apt-indices false \          --bootloaders syslinux \      --memtest none \  "${@}"  

here is my config/bootloaders/syslinux/syslinux.cfg

include menu.cfg  #default vesamenu.c32  default live-@FLAVOUR@  prompt 0  timeout 1  

And here is config/bootloaders/syslinux/menu.cfg

menu hshift 0  menu width 82    menu title Boot menu  #include stdmenu.cfg  timeout 1  label live-@FLAVOUR@      menu label ^Live (@FLAVOUR@)      menu default      linux @LINUX@      initrd @INITRD@      append @APPEND_LIVE@  

But still when booted, it always show the standard boot menu and do nothing until I press ENTER.

Stdandard Boot Menu

Kindly please give me some clue to fix this problem

Extending LVM partition with unallocated space on CentOS guest system

Posted: 13 Jun 2022 01:06 AM PDT

I believe this is an easy question for people in the know.

I have ~100 GB unallocated hard disk space that I want to use to extend my home partition. What commands do I need to run?

[paul@localhost ~]$ lsblk    NAME                 MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT  sda                    8:0    0   360G  0 disk  ├─sda1                 8:1    0     1.5G  0 part /boot  └─sda2                 8:2    0   254.4G  0 part    ├─centos-root 253:0    0    10G  0 lvm  /    ├─centos-swap 253:1    0   1.4G  0 lvm  [SWAP]    └─centos-home 253:2    0 243G  0 lvm  /home  sr0                   11:0    1  1024M  0 rom  

What I want is the centos-home size to increase to the maximum possible (from 243G to about 340G)

Thanks!

More info: This CentOS7 is running as a VM guest on a Windows 10 Host

I've found many guides online, but none were specifically answering my issue. One increased the centos-root partition instead of centos-home, so I reset the whole VM. Another guide was for moving space from root to home, so not what I need. It can't be difficult I'm just a noob. Thanks!

apt-get broken can't install anything

Posted: 13 Jun 2022 04:06 AM PDT

I was trying to install alien when i got this error ..

root@Linux:~# apt-get install alien  Reading package lists... Done  Building dependency tree         Reading state information... Done  You might want to run 'apt --fix-broken install' to correct these.  The following packages have unmet dependencies:   alien : Depends: rpm (>= 2.4.4-2) but it is not going to be installed           Depends: rpm2cpio   texlive-extra-utils : Depends: texlive-plain-generic (>= 2020.20200417) but it is not going to be installed                         Recommends: liblog-log4perl-perl but it is not going to be installed   texlive-pstricks : Depends: texlive-plain-generic (>= 2020.20200417) but it is not going to be installed  E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).  

when i try the suggestion "apt --fix-broken install" i get

Do you want to continue? [Y/n] y  (Reading database ... 390141 files and directories currently installed.)  Preparing to unpack .../texlive-plain-generic_2020.20200417-1_all.deb ...  Unpacking texlive-plain-generic (2020.20200417-1) ...  dpkg: error processing archive /var/cache/apt/archives/texlive-plain-generic_2020.20200417-1_all.deb (--unpack):   trying to overwrite '/usr/share/doc/texlive-doc/fonts/fontname/8a.html', which is also in package texlive-generic-recommended 2014.20141024-2  dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)  Errors were encountered while processing:   /var/cache/apt/archives/texlive-plain-generic_2020.20200417-1_all.deb  E: Sub-process /usr/bin/dpkg returned an error code (1)  

i tried removing texlive-generic-recommended and it gave me again the first error above I'm no expert in linux i just get by and i can't fix this any thoughts ?

cat /etc/apt/sources.list  deb https://http.kali.org/kali kali-rolling main non-free contrib  #deb-src https://http.kali.org/kali kali-rolling main non-free contrib  
ls -la /etc/apt/sources.list.d  total 12  drwxr-xr-x 2 root root 4096 Sep 24  2019 .  drwxr-xr-x 7 root root 4096 Apr 13 21:46 ..  -rw-r--r-- 1 root root  189 Sep 24  2019 google-chrome.list  

Customizing kdm Ghost Theme in Kali linux

Posted: 13 Jun 2022 03:00 AM PDT

I am using Kali Linux and just switched to kdm plasma desktop from gnome. I installed the futuristic ghost theme. As we get wifi and recording icons at the top right of desktop in gnome, i couldn't find a way to pin these icons in kdm desktop. How can i find these wifi , recording icons and pin them in the task bar in kdm ghost themed desktop in kali linux?

this is my current desktop :

enter image description here

and this is the style i want it, as you can see wifi and recording icons at the top right corner :

enter image description here

Check my DHCP lease?

Posted: 13 Jun 2022 02:23 AM PDT

Is there a way to show my current (client) DHCP lease?

Or even better - retrieve all options/infos sent with DHCPACK?

How to disable Wifi Power Save on Kali Linux

Posted: 13 Jun 2022 02:04 AM PDT

I am running kali with virtualbox and my wifi receiver is a usb adapter which is Asus N10 Nano. I made the settings on virtualbox for making the vb recognize my usb wifi adapter. It works but after like 5min my internet drops. Especially during the updates. I figured it out its because the "Wifi Power Save" option is on. I turned it off and tried again. When i turned it off my wifi turned off at the same time. I tried to turn my wifi on but the Wifi Power Save option turned on itself automatically. The usb icon on bottom is like red-green. It needs to be blinking green to work correctly. If i can turn off the Wifi Power Save mod permamently hopefully its gonna be blinking green. I searched for it, I did almost everything like creating directory as /etc/pm/power.d/wireless and editing the file wireless by these commands:

#!/bin/sh  /sbin/iwconfig wlan0 power off  

Then i gave the permission -x for it. It didnt work. Sorry if I had mistake while I was writing this. Thanks for helping!

lspci output:

00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)  00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]  00:01.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)  00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter  00:04.0 System peripheral: InnoTek Systemberatung GmbH VirtualBox Guest Service  00:05.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01)  00:06.0 USB controller: Apple Inc. KeyLargo/Intrepid USB  00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)  00:0d.0 SATA controller: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] (rev 02)  

It didn't work. In the end sudo depmod rtl8192cu output was: depmod: FATAL: rtl8192cu: not absolute path.

Concatenate multiple files with same header

Posted: 13 Jun 2022 02:11 AM PDT

I have multiple files with the same header and different vectors below that. I need to concatenate all of them but I want only the header of first file to be concatenated and I don't want other headers to be concatenated since they are all same.

for example: file1.txt

<header>INFO=<ID=DP,Number=1,Type=Integer>  <header>INFO=<ID=DP4,Number=4,Type=Integer>  A  B   C  

file2.txt

<header>INFO=<ID=DP,Number=1,Type=Integer>  <header>INFO=<ID=DP4,Number=4,Type=Integer>  D  E   F  

I need the output to be

<header>INFO=<ID=DP,Number=1,Type=Integer>  <header>INFO=<ID=DP4,Number=4,Type=Integer>  A  B  C  D  E   F  

I could write a script in R but I need it in shell?

Why does awk do full buffering when reading from a pipe

Posted: 13 Jun 2022 03:01 AM PDT

I'm reading from a serial port connected to a gps device sending nmea strings.

A simplified invocation to illustrate my point:

  $ awk '{ print $0 }' /dev/ttyPSC9     GPGGA,073651.000,6310.1043,N,01436.1539,E,1,07,1.0,340.2,M,33.3,M,,0000*56    $GPGSA,A,3,28,22,09,27,01,19,17,,,,,,2.3,1.0,2.0*39    $GPRMC,073651.000,A,6310.1043,N,01436.1539,E,0.42,163.42,070312,,,A*67    GPGGA,073652.000,6310.1043,N,01436.1540,E,1,07,1.0,339.2,M,33.3,M,,0000*55    $GPGSA,A,3,28,22,09,27,01,19,17,,,,,,2.3,1.0,2.0*39  

If I instead try to read from a pipe, awk buffers the input before sending it to stdout.

$ cat /dev/ttyPSC9 | awk '{ print $0 }'  <long pause>  GPGGA,073651.000,6310.1043,N,01436.1539,E,1,07,1.0,340.2,M,33.3,M,,0000*56  $GPGSA,A,3,28,22,09,27,01,19,17,,,,,,2.3,1.0,2.0*39  $GPRMC,073651.000,A,6310.1043,N,01436.1539,E,0.42,163.42,070312,,,A*67  GPGGA,073652.000,6310.1043,N,01436.1540,E,1,07,1.0,339.2,M,33.3,M,,0000*55  $GPGSA,A,3,28,22,09,27,01,19,17,,,,,,2.3,1.0,2.0*39  

How can I avoid the buffering?

Edit: Kyle Jones suggested that cat is buffering it's output but that doesn't appear to be happening:

$ strace cat /dev/ttyPSC9 | awk '{ print $0 }'  write(1, "2,"..., 2)                    = 2  read(3, "E"..., 4096)                   = 1  write(1, "E"..., 1)                     = 1  read(3, ",0"..., 4096)                  = 2  

When I think about it: I thought that a program used line buffering when writing to a terminal and "regular buffering" for all other cases. Then, why is cat not buffering more? Is the serial port signaling EOF? Then why is cat not terminated?

No comments:

Post a Comment