Skip to content

Script not execute #75

@spavlovich001

Description

@spavlovich001

Script execute from commandline and print result, but not execute from dwmblocks

#!/usr/bin/env bash
# set -x


DEV_NAME=/dev/sda

function formatted_load() {
    iostat -xd "${DEV_NAME}" 1 2 | awk '
        /sda/ {
            if (++n == 2) {
                val = int($NF)
                printf "%02d\n", val
            }
        }
    '
}

raw_value=$(formatted_load)
printf "%02d\n" "$raw_value"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions