[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Display backslash-n in dialog?

From: Moray Henderson
Subject: Display backslash-n in dialog?
Date: Mon, 25 Jul 2011 12:55:18 +0100



Is there a nice way to display the literal sequence ‘\n’ in dialog?  I'm writing a confirmation box for deleting a set of directories from a Windows perspective:


  dialog --yesno "This will delete:\n - I:\\$CHOICE\n - P:\\$CHOICE\nContinue?" 8 40


It works perfectly until the directory name in $CHOICE begins with ‘n’.  The best I have been able to come up with is to separate the backslash and $CHOICE with a space-backspace sequence:


dialog --yesno $'This will delete:\n - I:\\ \b'"$CHOICE"$'\n - P:\\ \b'"$CHOICE"$'\nContinue?' 8 40


It works after a fashion, but the code is ugly and so is the output:




I’m using CentOS 5.6, dialog Version: 1.0-20051107, writing a program to help manage Samba services (hence the need for Windows-style paths).




“To err is human; to purr, feline.”



reply via email to

[Prev in Thread] Current Thread [Next in Thread]