212 questions
-3
votes
1
answer
160
views
How can I dissect a shell 1-liner workflow to understand what this git command does? [closed]
I am updating an existing pipeline on GitLab that creates an automatic cascade on GitLab.
When a merge request is merged, the pipeline is triggered to perform an automatic commit to a lower branch (if ...
1
vote
0
answers
266
views
Jenkins pipeline fails on git ls-remote command with error can't run program "nohup" in Failed to exec spawn helper: pid: 1224365
Jenkins pipeline failed on command:`curl -H 'X-JFrog-Art-Api: ****' -H 'Content-Type: text/plain' --data-raw 'items.find(
[2024-12-08T18:21:14.465Z] {
[2024-12-08T18:21:14.465Z] "...
0
votes
4
answers
244
views
Is there a way to have fish-shell use GNU coreutils printf function?
Ran into an issue when running the following command in a fish shell:
❯ printf '%q\n' 'André Previn & London Symphony Orchestra'
%q: invalid conversion specification
I hadn't realized at first ...
1
vote
0
answers
117
views
what locale does grep use if no environment variable explicitly sets it?
In case this is relevant: I'm using Git Bash for Windows but NOT the usual mintty launcher (I'm running bash directly), so I have fewer environment variables set than "normal". In ...
1
vote
0
answers
38
views
Why can't the comm command tell the difference between ✓ & ⨯ when LANG=en_US.UTF-8?
If I have two files, a.txt containing:
meow ✓ bar
and b.txt containing:
meow ⨯ bar
Why can't the GNU Coreutils command comm tell the difference between the two when $LANG is set to a UTF-8 encoding?
...
0
votes
1
answer
115
views
truncate does not support creating files with sizes greater than 2^63-1
Apparently, gnu truncate on my x86_64 system does not support creating files with sizes of size >= 8EiB (= 2^63 Bytes = 9223372036854775808 Bytes).
/usr/bin/truncate: ELF 64-bit LSB pie executable, ...
0
votes
3
answers
534
views
How to get the same CRC32 like cksum?
I took the source code of cksum and copied the polynomial. This gives the same as the predefined IEEE variant defined in the Go standard library.
package main
import (
"fmt"
"...
0
votes
0
answers
78
views
Temporarily storing piped input in C command line utility
I have been working on creating a coreutils style C program that does a Cesar shift cipher on a given input. Here is the link to the repository. Right now, the program only reads a specified file and ...
1
vote
1
answer
91
views
Two seemingly different functions with same name exist in the C program (using DWARF info), why?
I have been going through the assembly code of the sort program in the GNU Coreutils and found something I can't figure out and explain in a technological sense of why this is happening.
It all ...
0
votes
0
answers
34
views
Why does GNU expr produce 0 for "expr a \> -aa"?
Does any one know why
$ expr a \> -a
produce 1 and
$ expr a \> -aa
produce 0?
The version of coreutils:
$ pacman -Q coreutils
coreutils 9.4-2
It produce the same result when ...
1
vote
0
answers
94
views
Is the coreutils `diff` utility deterministic in output?
Based on my understanding of a diff algorithm that computes the difference between two files, there is more than one potential way any two files can be represented as a diff. The diff utility attempts ...
0
votes
1
answer
74
views
Is it a bug in the UNIX cut command that when selecting a specific field with a line with no delimiters, it returns the whole line?
I found this behavior of coreutils utility cut a bit weird
echo "
one,line1
two,line2
three
four,line4
" | cut -d ',' -f1
, got expected result:
one
two
three
four
But:
echo "
one,...
0
votes
1
answer
105
views
Encountering an error during configuration of iTerm2
This error happens in my ~/.zshrc when configuring iTerm2.
.zshrc:117: parse error near `\n'
The following is the last few lines of my ~/.zshrc.
111 source /opt/homebrew/share/zsh-syntax-highlighting/...
2
votes
1
answer
1k
views
Wrong dynamic linker used when building Zig from source using Nix
I made the following small Nix derivation to locally build the Zig toolchain from source for me to use locally as part of a Nix shell.
with import (fetchTarball {
url = "https://github.com/...
3
votes
0
answers
536
views
Portable way to `strip` during `install` while cross-compiling
When install -s is run, it calls strip program as is, resulting in host-provided version of this program to be run, which breaks cross-compilation scenarios where target-specific version of strip must ...
-1
votes
1
answer
99
views
Replace multiple lines of whitespace with one line using sed [closed]
How could I use sed to replace multiple lines of whitespace (including tabs and spaces) with just one empty line?
Example input:
Line 1
<Space><Space>
Line 2
<Tab>
Line 3
Line 4
...
2
votes
1
answer
94
views
du behaves as if -h was always given
I noticed a strange behaviour of du on my system. It always assumes the -h option is set.
Even if I call /usr/bin/du directly. No alias is set. This very much get's in the way if I want to do ...
1
vote
0
answers
1k
views
ls -l in Docker shows question marks in place of file permissions and stats
Before I begin, there are other questions that mention that ls -l produces questions marks but those are due to permissions issue. This question is different. Hopefully!
I have a decommissioned Docker ...
0
votes
1
answer
429
views
cksum command doesn't recognize -a option
I'm trying to automate checksum generation with CRC32, SHA1, and SHA256 algorithms on a directory of files, and I'm getting errors from cksum (v.8.32)
According to the cksum manual at gnu.org, it ...
2
votes
0
answers
240
views
Coreutils : "error: automatic de-ANSI-fication support has been removed"
I am trying to compile coreutils in my local but I am facing the following error:
...
./bootstrap: m4/wchar_t.m4 overrides ._bootmp2/m4/wchar_t.m4
./bootstrap: m4/wint_t.m4 overrides ._bootmp2/m4/...
0
votes
1
answer
68
views
coreutils: print nth line in file, block until it exists
How would I print the nth line of a file or input, and block until it exists? I want to stick to coreutils.
sed 'NUMq;d' file will quickly give me the nth line, but doesn't block.
tail -f file will ...
-1
votes
1
answer
231
views
bootstrap fails due to a certificate mismatch
When running ./bootstrap in a freshly-cloned repository (https://github.com/coreutils/coreutils), it seems to either
not find some files it wants to or doesn't trust https://translationproject.org.
./...
0
votes
1
answer
152
views
Git commit doesn't accept summary
So I've recently cloned the gnu-coreutils to see how the programs I use actually work, and to get more familiar with git, especially git's CLI. But when I tried committing a change I made to basename....
0
votes
3
answers
566
views
Why not add a base16 into coreutils?
Both base32 and base64 CLI utils are part of gnu coreutils. So, why not add a base16?
0
votes
1
answer
47
views
GNU Coreutil Date (outputs numbers in CLI but not in bash script)
Whenever I run a command in bash CLI, I get the right output
date +%Y%-m%d%j%M%S
202111063103528
However, when I run this in a bash script, I am not getting a simple number that I can use in a later ...
-1
votes
3
answers
188
views
How would a sysadmin calculate sysadmin day?
Sysadmin day is the last Friday of July.
Sysadmins tend not to stray too far from the terminal, where they belong.
Sysadmins grok man {,/usr}/bin/*.
Sysadmins sometimes stray into interpreted ...
1
vote
1
answer
100
views
What is _("standard output") ? A reserved function? [duplicate]
I'm trying to read linux commands C sources. I started with cat which is one of the shortest, and supposedly easiest, and I found this on line 645:
if ( fstat(STDOUT_FILENO, &stat_buf) < 0)
...
2
votes
1
answer
596
views
Issues matching zero-byte using grep
I'm trying to find 7zip version 3 file headers in a file. According to the documentation they should look like this:
00: 6 bytes: 37 7A BC AF 27 1C - Signature
06: 2 bytes: 00 04 ...
1
vote
1
answer
181
views
Recompiling ls command to get wanted colors of a file beginning by README_* , i.e extended with a string
I make following to this post : export-ls-colors-apply-the-rule-for-every-file-beginning-by-readme
I summarize the issue briefly:
eval `/opt/local/libexec/gnubin/dircolors ~/.dircolors`
export ...
1
vote
1
answer
327
views
How does cat interpret a file when it initially reads it?
I have been researching into the usage of the cat command on a deeper level (long story) and I was wanting to clarify understanding.
When we cat a binary, let's say the cat binary itself: cat /usr/bin/...
1
vote
1
answer
2k
views
How to check if a binary file is contained inside another binary from the Linux command line?
Basically I want a "multiline grep that takes binary strings as patterns".
For example:
printf '\x00\x01\n\x02\x03' > big.bin
printf '\x01\n\x02' > small.bin
printf '\x00\n\x02' > ...
0
votes
1
answer
143
views
Sort data file based on a separate key file
We have 2 files: data.txt and keys.txt.
data.txt is some proper unicode text with N lines.
keys.txt is a list of newline-separated integers, N lines.
Output a file sorted.txt where the lines in data....
0
votes
0
answers
41
views
Why are strings generated by gsha256sum 512 bits long?
On MacOS with brew install coreutils, when executing:
$ SEED="I am a seed"
$ SECRET=$(echo -n $SEED|gsha256sum | cut -d\ -f1)
...
1
vote
1
answer
543
views
Counting characters, a Java program and wc yield inconsistent results
I wrote a java program that counts the number of characters in a file. To check that the program is working correctly, I type this into the command line (linux) to check the number of characters:
wc -...
2
votes
1
answer
508
views
Why does timeout not interrupt `git status` when it takes too long?
Running timeout 0.01s git status on a large repo where git status takes about a second doesn't do anything different from git status. I.e., timeout doesn't seem to interrupt Git when it takes too long....
4
votes
2
answers
2k
views
How to cross-compile Coreutils or other GNU projects with clang/LLVM?
I have a tough need to compile Coreutils with llvm for other arch: arm/aarch64/mips/mips32/ppc/ppc32...
Since I install all the gcc-cross tools like mips-linux-gnu, powerpc64-linux-gnu and if I have ...
3
votes
1
answer
1k
views
Error compiling coreutils - error: function might be candidate for attribute 'const' [-Werror=suggest-attribute=const]
I try to compile coreutils on Ubuntu 18.4. Here is what I did so far:
sudo apt install bison gperf make textinfo
git clone git://git.sv.gnu.org/coreutils
cd coreutils
./bootstrap
./configure
...
0
votes
1
answer
239
views
How to use the max-time tag with klee
I'm trying to run klee on a compiled bytecode version of the coreutils, somewhat replicating the experiment that klee did a while back.
I'm having some trouble figuring out how to use the --max-time ...
2
votes
1
answer
683
views
Why does GNU Find care about a trailing slash in this situation?
Given:
I am running GNU/Linux
I have some Git repositories in /path/to/repos.
I want to check whether any files in the myrepo repository were modified after a particular time.
find /path/to/repos/...
3
votes
1
answer
2k
views
Detect if coreutils is installed on mac
Without using brew, how can I detect if coreutils is installed on the mac where my bash script is running.
here is my script:
#!/usr/bin/env bash
check_bash_version () {
echo "checking which bash ...
0
votes
1
answer
508
views
Configure Error on KLEE Docker: C compiler cannot create executables
I'm trying to build Coreutils with LLVM, using klee docker based on step 3 on https://klee.github.io/tutorials/testing-coreutils/.
But I found a problem on running:
CC=wllvm ../configure --disable-...
3
votes
1
answer
4k
views
Why touch - doesn't return any error and yet is not creating the file -?
I wanted to create a file called "-" through the command touch.
touch -
I expected an error or the creation of the file, however no error and no file creation.
Also, how can I create the file called ...
0
votes
1
answer
967
views
Yoctoproject - include newer coreutils (stat)
I am trying to build a custom distribution for an embedded device. I need the 'stat'-command (which is part of GNU coreutils) to support long-options, e.g. stat --printf.
The stat-version the build ...
1
vote
0
answers
1k
views
GCC attribute no_instrument_function not working
I am trying to add entey/exit hooks to ls in the coreutils package. I followed instuctions from here to get the source and build it:
https://askubuntu.com/questions/976002/how-to-compile-the-sorcecode-...
1
vote
1
answer
229
views
What is /usr/local/Cellar/coreutils/8.31/bin/g[
What is /usr/local/Cellar/coreutils/8.31/bin/g[?
g[ is an odd file name.
It obviously appears to have been installed by the homebrew coreutils formula, but I can't find any documentation about it.
0
votes
1
answer
502
views
Failed to re-compile coreutils with overrides with Nix
As discussed in this question, overriding attributes of derivations, that are essential to Nix itself is more complicated than usual.
I tried to use code, provided in example, and encountered more ...
0
votes
1
answer
288
views
Why could GNU sort be hanging for 10 hours+ on this specific file
I'm attempting to merge & dedupe several different versions of the same kind of plain txt file using gnu sort that comes with Ubuntu 18 lts. I have used sort a lot almost daily with no issues ...
2
votes
1
answer
1k
views
Failed to build coreutils: command execution failed(form macports returned)
I'm trying to install php-zip via macports to my macOS.
sudo port install php73-zip
then the macports returns this message:
The following dependencies will be installed:
coreutils
...
...
Error: ...
1
vote
2
answers
190
views
Parse Date Pattern
I'm trying to convert the Date into a specific format using awk and following are the commands that I've tried.
$ echo | awk -v Date=`date -d '2019-10-07' '+%Y-%m-%dT%H:%M:%S'` '{print Date}'
2019-...
1
vote
0
answers
48
views
Colorizing output while using pr
I'm running some commands that returns lists of strings and getting their output in different variables.
Then I want to write the different command's output side by side. For this, I'm using pr.
A ...