LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-15-2018, 04:13 PM   #1
Greggers23
LQ Newbie
 
Registered: May 2018
Posts: 2

Rep: Reputation: Disabled
Bash script format issue


Hi Guys,
Would anyone know how to format the output of a list command such as history within a bash script that is redirected to a txt file so that it prints as a list when viewed on windows 10 ?

Last edited by Greggers23; 05-15-2018 at 06:34 PM.
 
Old 05-15-2018, 04:22 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
You would insert line breaks '\n' where you want a new line in the output. From what you've told us, there's not much more I can tell you.
 
Old 05-15-2018, 04:25 PM   #3
Greggers23
LQ Newbie
 
Registered: May 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
Sorry, for the lack of detail originally.
For instance if you were running the following - history > file.txt - but the format does not appear as a list.

Last edited by Greggers23; 05-15-2018 at 06:35 PM.
 
Old 05-15-2018, 04:27 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,554

Rep: Reputation: 3146Reputation: 3146Reputation: 3146Reputation: 3146Reputation: 3146Reputation: 3146Reputation: 3146Reputation: 3146Reputation: 3146Reputation: 3146Reputation: 3146
Windows and linux use different text end of line characters. There are many Windows text editors that can automatically detect the type of text file but notepad does not. The simple solution would be to use wordpad instead of notepad but you can also convert the file too.
 
  


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
Bash script issue vinodm41 Linux - General 3 01-02-2018 12:14 AM
Bash Script Issue wildbi111 Programming 5 06-17-2016 03:22 PM
[SOLVED] Bash script issue kingston Linux - Newbie 10 10-07-2015 09:04 AM
Putty using csv files in BASH to format file in script as output smks Linux - Newbie 7 12-22-2011 06:50 PM
Bash script issue tibix00 Programming 22 07-21-2011 01:23 PM

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

All times are GMT -5. The time now is 07:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration