Skip to main content

Questions tagged [test]

This is about the Unix utility "test," also invoked as "[", or its shell syntax [[ … ]] variant. For questions about testing software and setups, use the "testing" tag.

0 votes
1 answer
52 views

PostfixAdmin installed successfully. To test whether internal sending and receiving mail work, I used SMTP to send mail: telnet mail.example.com 25 Trying 94.284.174.110... Connected to mail.example....
lachin's user avatar
  • 29
5 votes
2 answers
282 views

In the old times of DOS batch scripts, the only way to check for a variable to be empty or to allow an empty variable was to prepend (or append) a known letter, commonly the letter x, because there ...
Rainer Glaschick's user avatar
2 votes
1 answer
185 views

Continuing Semicolon in conditional structures (which handles single brackets), what's the point of having a semicolon after the closing DOUBLE bracket ]]? In my tests, running #!/bin/zsh -- if [[ &...
AlMa0r's user avatar
  • 1
3 votes
1 answer
86 views

When I run the following code declare -A X # get an associative array index="a'b" # a somewhat weird index X[$index]="this is set" echo "<<${X[$index]}>>" if ...
Harald's user avatar
  • 1,050
0 votes
2 answers
257 views

Extremely "noob" question: I have a running sudo memtester ... on an Ubuntu 22.04 machine, but I gave it too much memory to test and it's taking too much time (I see it running and updating, ...
pglpm's user avatar
  • 162
0 votes
2 answers
256 views

I'm trying to check if the value inside a file is "0". COUNT_EXECUTION=$(< /tmp/count) if [ "$COUNT_EXECUTION" == "0" ]; then echo "Try restart service." ...
Aderbal Nunes's user avatar
1 vote
1 answer
111 views

I want to test if the output of a function matches the text I envision it should write to standard output. But the code below never prints test PASS and I can't figure out why. I also tried putting ...
branco's user avatar
  • 13
1 vote
2 answers
745 views

Here's what I'm trying to do (in a script): #!/usr/bin/env bash if [[ ! $("/usr/bin/scp [email protected]:/Users/seamus/Downloads/imgutils/image-utils* /home/pi/testscp") ]]; then ...
Seamus's user avatar
  • 3,928
0 votes
0 answers
228 views

I'm currently building Linux From Scratch 12.1 with the book, I've followed the instructions line by line. I'm struggling with the GCC testsuite, I have lots of FAIL and timeout. In addition to that, ...
noxen's user avatar
  • 1
2 votes
2 answers
97 views

I have following in a bash script: echo "status: [$status] and message: [$message]" if [ "${status}" -eq 0 && "$message" = "ERROR" ]; then echo &...
Nullpointer's user avatar
1 vote
1 answer
164 views

From man bash: -n string True if the length of string is non‐zero. Examples: # expected $ var=""; [ -n "$var" ]; echo $? 1 # unexpected? $ var=""; [ -n $var ]; echo ...
pmor's user avatar
  • 757
0 votes
0 answers
110 views

If I have /mydir/myfile.txt this code echos file already exists if [ ! -f "/mydir/myfile.txt" ]; then touch "/mydir/myfile.txt" echo "created file" else echo ...
d-b's user avatar
  • 2,077
0 votes
1 answer
227 views

I have setup a little script to illustrate my problem. I have set up a while loop that I would like to keep looping as long as $output is equal to No screen session found #!/bin/bash echo Stopping ...
Kuba0040's user avatar
0 votes
2 answers
927 views

I am relatively new to shell, and I am getting a syntax error where I am still confused. #!/bin/dash ls="ls -l test" small=0 medium=0 large=0 for i in $(seq 11 9 56) do filename=$(echo ...
user avatar
0 votes
1 answer
53 views

I want to determine all broken symlinks within a directory. In ignorance of a better solution, I tried this simple bash one-liner (bash version is 4.2.46, which may be worth mentioning because it's a ...
andreee's user avatar
  • 203

15 30 50 per page
1
2 3 4 5
25