FG
💻 Software

How do I use the -ne flag for echo in a shell script?

Fresh5 days ago
Mar 15, 202615346 views
Confidence Score0%
0%

Problem

I'm trying to create a shell script to take an argument and use it to name a terminal tab. So if the script's name is tabnm, tabnm "test" should rename the current tab "test" This is my code: but when i run it I get this output: If I just run straight in the shell, the tab is renamed.

Error Output

#!/bin/sh
echo -ne "\e]1;$1\a"

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How do I use the -ne flag for echo in a shell script?

Low Risk

That would be the difference between in vs. your interactive shell. I suggest using instead, and see The UNIX and the .

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment