LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-13-2023, 09:33 PM   #1
Faki
Member
 
Registered: Oct 2021
Posts: 574

Rep: Reputation: Disabled
Testing capname attributes for constructing tput command


I want to set the capname for use with tput. But I need to modify the following bash part to test whether the capname is valid, before computing erps.

What can I do

Code:
if [[ -n "$cn" ]]; then
  erps="tput ${cn}"
fi
For capname I should have any one of the following attributes.

Code:
bold smul rmul rev blink invis smso rmso sgr0
 
Old 04-14-2023, 05:33 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,992

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
Code:
case $cn in
   bold|smul|rmul|rev|blink|invis|smso|rmso|sgr0) accepted
   *) not accepted
esac
 
  


Reply

Tags
bash



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH-Constructing array from large numerical matrix .txt hippotonic Linux - Newbie 8 12-13-2009 07:24 PM
Need Help in constructing a script rajesh.bahl Linux - Server 1 06-05-2009 01:32 PM
Need Help in constructing a Script rajesh.bahl Linux - Security 1 06-05-2009 05:08 AM
constructing a beowolf cluster Goatdemon Linux - General 16 12-31-2005 11:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration