WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: shell script and \n  (Read 1640 times)

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
shell script and \n
« on: September 16, 2014, 02:23:41 AM »
Hi all,
Doing a little basic shell scripting, and noticed that my script writes the \n character on screen, instead of creating a new line.

Heres an example
Quote
echo "\n" $sep "SUCCESS Remote backup COMPLETED on $DateTime. E-mail sent with details.\n"

Will write the following to screen.

\n -------------------------------------------------------------------\n SUCCESS Remote backup COMPLETED on 06:23:13 AM 16-23-2014. E-mail sent with details.\n
Live long and prosper.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: shell script and \n
« Reply #1 on: September 16, 2014, 02:31:33 AM »
echo -e "\n"
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline remus

  • Sr. Member
  • ****
  • Posts: 371
Re: shell script and \n
« Reply #2 on: September 16, 2014, 03:02:15 AM »
thanks bmarkus, that works, its not required in ubuntu, is this the tinycore way ?
Live long and prosper.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: shell script and \n
« Reply #3 on: September 16, 2014, 03:21:29 AM »
Not TC, BusyBox shell. On system level forget *BUNTU as a reference.

It is a good practice to study TC scripts before writing scripts for TC.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."