LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-25-2014, 11:49 AM   #1
number22
Member
 
Registered: Sep 2006
Location: Earth
Distribution: Slackware 14.1 Slackware64-current multilib
Posts: 278
Blog Entries: 7

Rep: Reputation: Disabled
Smile script file for colourful slackware /etc/issue


I made a colourful Slackware /etc/issue a while back on my blog here, but it is just plain text file with embedded escape sequence; here is a script to output file for people couldn't switch ^[ with escape sequence.
Code:
echo -e " " > issue
echo -e "\e[0;32m   _____    \e[0;34m _                  _  " >> issue
echo -e "\e[0;32m  / ____|   \e[0;34m| |                | | " >> issue
echo -e "\e[0;32m | (___     \e[0;34m| |   __ _    ___  | | __ \e[0;33m__      __   __ _   _ __    \e[0;35m___ "  >> issue
echo -e "\e[0;32m  \\\\\\___ \\\\\\    \e[0;34m| |  / _\\\` |  / __| | |/ / \e[0;33m\\\\\\ \\\\\\ /\\\\\\ / /  / _\\\` | | \\\'__| \e[0;35m/ _ \\\\\ " >>
issue
echo -e "\e[0;32m  ____) |   \e[0;34m| | | (_| | | (__  |   <   \e[0;33m\\\\\ V  V /  | (_| | | |    \e[0;35m|  __/" >> issue
echo -e "\e[0;32m |_____/    \e[0;34m|_|  \\\\\\__,_|  \\\\\\___| |_|\\\\\\_\\\\\\  \e[0;33m \\\\\\_/\\\\\\_/    \\\\\\__,_| |_|     \e[0;35m\\\\\\___|" >
> issue
echo -e "\e[m" >> issue
echo -e "\n" >> issue
echo -e "\e[0;32mWelcome to\e[m\e[0;34m \s \e[0;36m\\\r\e[m (\e[0;31m\l\e[m) " >> issue
echo -e "\n" >> issue
Merry Christmas and Happy New Year.
 
Old 12-26-2014, 04:22 AM   #2
navigium
Member
 
Registered: Aug 2014
Location: Switzerland
Distribution: Slackware, FreeBSD
Posts: 119

Rep: Reputation: 58
Quote:
Originally Posted by number22 View Post
I made a colourful Slackware /etc/issue a while back on my blog here, but it is just plain text file with embedded escape sequence; here is a script to output file for people couldn't switch ^[ with escape sequence.

Merry Christmas and Happy New Year.
Thank you! I tried it but wherever you escape characters it doesn't line up properly on my machine. It lines up like this:

Code:
   _____     _                  _  
  / ____|   | |                | | 
 | (___     | |   __ _    ___  | | __ __      __   __ _   _ __    ___ 
  \\___ \\    | |  / _\` |  / __| | |/ / \\ \\ /\\ / /  / _\` | | \'__| / _ \\ 
  ____) |   | | | (_| | | (__  |   <   \\ V  V /  | (_| | | |    |  __/
 |_____/    |_|  \\__,_|  \\___| |_|\\_\\   \\_/\\_/    \\__,_| |_|     \\___|



Welcome to \s \r (\l)
 
Old 12-26-2014, 08:56 AM   #3
number22
Member
 
Registered: Sep 2006
Location: Earth
Distribution: Slackware 14.1 Slackware64-current multilib
Posts: 278

Original Poster
Blog Entries: 7

Rep: Reputation: Disabled
yes, if you just cat it out in regular bash shell, it looks like that, but you should try put it to normal tty login prompt, it looks normal, however on line 3 or 4, it might shift 1 space to the right, you can just modify output file(/etc/issue).
 
1 members found this post helpful.
Old 12-26-2014, 09:44 AM   #4
number22
Member
 
Registered: Sep 2006
Location: Earth
Distribution: Slackware 14.1 Slackware64-current multilib
Posts: 278

Original Poster
Blog Entries: 7

Rep: Reputation: Disabled
if you like to show more info on your login prompt; you can put \S \n.\O and other switches in Welcome to line.
 
Old 12-26-2014, 10:17 AM   #5
navigium
Member
 
Registered: Aug 2014
Location: Switzerland
Distribution: Slackware, FreeBSD
Posts: 119

Rep: Reputation: 58
Hey,

Thanks for the info. Before you posted this, I wasn't even aware what /etc/issue is here for (it's hard to miss if you have been using Linux only for ~18 years )
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] SFTP file upload bash script issue. moodah Programming 1 10-07-2010 10:55 PM
issue in using private key file in bash script manya Programming 3 08-24-2009 01:49 AM
Permission Issue With Shell Script and .Jar File timmit Slackware 3 06-02-2008 07:33 AM
Command interpretation issue in Sed script file angel115 Programming 9 04-21-2006 07:26 PM
script execution - file/directory permission issue serksimper Linux - Enterprise 1 08-10-2005 03:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:16 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