From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fPRsvBN0; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id CAC0E5A026F for ; Tue, 30 Sep 2025 00:24:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1759184662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=++MHkd4/joXwqOGfuDHPUKKGQoWF0Rhcj0zCrEynSx0=; b=fPRsvBN0fV5zJzLuUdfko3QcVTnesl6YKVwY9gxIs3j56VpuraWT6Llce+QE60Sg3A95au M8gTbXhvgN9w26Kl/iOuhVgdJMVrYZXkZbeq6fup9qaRslyW6ZHRPMwVjOHB667G8vcY4i 8NnO9D71NQMiHgA2JSdL7sdPqzdZkeo= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-444-9ABfxaAnPrWMXqiIwFgxMQ-1; Mon, 29 Sep 2025 18:24:21 -0400 X-MC-Unique: 9ABfxaAnPrWMXqiIwFgxMQ-1 X-Mimecast-MFC-AGG-ID: 9ABfxaAnPrWMXqiIwFgxMQ_1759184660 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-46e3a049abaso21639355e9.0 for ; Mon, 29 Sep 2025 15:24:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759184660; x=1759789460; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=++MHkd4/joXwqOGfuDHPUKKGQoWF0Rhcj0zCrEynSx0=; b=BiPKhMjnLhUDKwMj2QSginM2nypE0kvJrecDvYWHDmXiyNNcw4P8zrJrUvzMBDYERR pnBaxgOtWfEUWcsGKN1eJOsJXNh0EYnw36SSW7plSKwdAke4V1UztvEULMbUqsmrlAae rFxQwnXIdW4CEQlyBbS7iyOorlGLN3GX6QD6/aAhz4bLhbwen/2Loz7H7Jh/ZxDEG6Z4 /OzkT42hWpZjk1OJ/SgiwANCVdTpiHMcmYyrzf8gwoP8NIfdp7GbqjjDdUDQiwiGvyhr l27MqLbJWri1JgN8ZHSGw3HkSNH24Hqoa/TWjw8rrMFFedPblhT5wF7UY3Zv8NT0L+c+ id3Q== X-Gm-Message-State: AOJu0Yzl5oDLZrM3P5J2fXoA2+hPKu4AL5e0Mle5Au5Upd7KAnwh8TIf F7J5yvDHBChho+M30Y0HjVs6yUU2o0amzp2FksVS8+uwFnU2XSvRZqTNng08b6fTbNdZC0vcNe6 +MyxFHiIVqIwtuYL+IY2Ouh5hQTT62xpGxqUfSiUJ8kah/2Cawua2zg== X-Gm-Gg: ASbGnct6bKoCmhNmmdsH8w/mtKcQVFqj3of0SdBZzbl1cIfEPVyQ/6jOCZ2S+/8C9dQ ocUBBl4x68pQBZJwBeM5XqKupANkJLrCxHccVh97qae2VfgDZBsCE88c3wL2TaVwGFx6PyRit1B 5mN1d5BGrQsj3i4ZXjfSdsVAgzcAJLpY85Clejaq0scM0ipSESDABCpfVfxCgY4UON8NDg1SF5r BW/iHaW0/tRJKLjKaXpW6tIZlafxM+p3SUGGkpyQnJF/9Scwu0vsHqV1jKkyps+8WaBn++FG+4u sdp3JZNPIe4wMBfzKzRkbyo9tF+e2KkClnboNUg18r3CdepHqzA= X-Received: by 2002:a05:600c:4fcb:b0:46e:42aa:75b5 with SMTP id 5b1f17b1804b1-46e42aa7857mr93858055e9.4.1759184659911; Mon, 29 Sep 2025 15:24:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzHK01ertKpsjV8SJYWvrsI7Tk/9fbxOtKz5ftC62GsWoTohjdHK2sYu7xnxQ8AhLIkuReLw== X-Received: by 2002:a05:600c:4fcb:b0:46e:42aa:75b5 with SMTP id 5b1f17b1804b1-46e42aa7857mr93857855e9.4.1759184659299; Mon, 29 Sep 2025 15:24:19 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46e5873f2efsm26135225e9.4.2025.09.29.15.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Sep 2025 15:24:18 -0700 (PDT) Date: Tue, 30 Sep 2025 00:24:17 +0200 From: Stefano Brivio To: Yumei Huang Subject: Re: [PATCH] test: Fix printf error when debug is enabled Message-ID: <20250930002417.55172be7@elisabeth> In-Reply-To: <20250929063014.17293-1-yuhuang@redhat.com> References: <20250929063014.17293-1-yuhuang@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: fJVjwU4JnXlLd3gWgRYlYsrhM2m5LDwIAZufY5-5JUA_1759184660 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: UX4Y5FJ36AJXK6EQ4TJQAMDPUPVJS2KE X-Message-ID-Hash: UX4Y5FJ36AJXK6EQ4TJQAMDPUPVJS2KE X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, david@gibson.dropbear.id.au X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon, 29 Sep 2025 14:30:14 +0800 Yumei Huang wrote: > Running test pasta/tcp with debug enabled would get stuck with > below error: > > + printf 'DEBUG: ns socat -u OPEN:__BASEPATH__/big.bin TCP6:[__GW6__%__IFNAME__]:10003\n' > lib/term: line 38: printf: `_': invalid format character > > The error occurs because printf interprets the % character as the > start of a format specifier, and the following '_' isn't one of > them. > > Fix it by replacing 'printf "${*}\n"' with 'printf "%s\n" "$*"'. I'm not sure why, but this breaks colour highlights for me. Instead of seeing a part of this message in blue, now I get: Test layout: \033[1;34msingle passt instance with guest\033[0m.\n I can look into it if it only happens for me, or if needed. By the way (I'm not sure if it's related), I used curly brackets everywhere to unambiguously distinguish names of variables, and '*' is a name. The curly brackets are almost always optional, see POSIX.1-2024 for the cases where they are needed: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02 ...to avoid possible issues, I just used them everywhere, and I think it would be good to keep this consistent. That is, the $* should remain as ${*}. -- Stefano