bash script to display tail


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting bash script to display tail
# 8  
Old 04-08-2011
There is a typo in the sed command. Should contain only three slashes, not four. Should be :
Code:
sed 's/$/\r/'

instead.
This command will add a carriage return (\r) to the end of line ($), which will make it windows-like.
# 9  
Old 04-08-2011
When I said "remove", I meant "add" (being unix2dos, not dos2unix)Smilie

There's a slash too many:
Code:
... | sed 's/$/\r/'

# 10  
Old 04-08-2011
Ok, it works pretty good, except a couple things:
Instead of the output being
Code:
winfile

it comes out as
Code:
winfile?

.
After entering the command at the command line, it responds:
Code:
: command not found

.
but looking in "winfile?", the command executed beautifully.
# 11  
Old 04-09-2011
Quote:
Originally Posted by LuminalZero
Ok, it works pretty good, except a couple things:
Instead of the output being
Code:
winfile

it comes out as
Code:
winfile?

.
After entering the command at the command line, it responds:
Code:
: command not found

.
but looking in "winfile?", the command executed beautifully.
Let me guess, you edited the script in Notepad? Your file is probably named "winfile\r"
# 12  
Old 04-09-2011
Not in notepad, in vim. Somehow it had saved it as a dos file. I used unix2dos on it and now it works flawlessly though. Thanks for the help everyone. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

How to display certain line of file only using head or tail in 1 command?

First month learning about the Linux terminal and it has been a challenge yet fun so far. We're learning by using a gameshell. I'm trying to display a certain line ( only allowed 1 command ) from a file only using the head or tail. I'm pretty about this answer: head -23 history.txt | tail -1... (1 Reply)
Discussion started by: forzatekk
1 Replies

2. Shell Programming and Scripting

Bash script to display result in table

My script gives the following result. Is it possible to display the same in table format ? 1. rex_best Latest feeds are not avaialable. The last feed was generated on 2012-05-17 File Name = ekb_best_20120517_010949_665.tar.gz The Number of entry elements = 4209539 2. rex_genre Latest... (2 Replies)
Discussion started by: kishorekumar87
2 Replies

3. UNIX for Dummies Questions & Answers

head\tail how to display middle lines

hay i need to display middle line: 1 2 3 4 5 how can i display 3-4? (6 Replies)
Discussion started by: margan_ron
6 Replies

4. Shell Programming and Scripting

How to refresh a graphical display through bash script

Hi folks , I need to display a message graphically using a messagebox or textbox through bash script. However the message should be keep changing every 4 secs . I input the message from a file and use "gxmessage" to display it . gxmessage -nofocus -center -title "Welcome screen" -geometry... (3 Replies)
Discussion started by: ddspark
3 Replies

5. Shell Programming and Scripting

Display Specific line number using tail command

Hi , 1)i want to display specific line number using tail command. e.g. display 10 line from end. Please help... 2)Want to display line 10 to 15 (from end)using tail command) (2 Replies)
Discussion started by: vivek1489
2 Replies

6. Shell Programming and Scripting

bash script tail when string found do something

Okay, I have two scripts, the first one does some stuff, and comes to a point where it has this: Right here it runs a quick script to start something that writes to a log file. /usr/bin/tail -f ${pathVar}/nohup_${servVar}.out | while read -r line do ] && continue cd ${pathVar}... (0 Replies)
Discussion started by: cbo0485
0 Replies

7. Shell Programming and Scripting

Display runnning countdown in a bash script?

I am looking for a way to display on a single line, a running countdown for a given amount of time in a terminal using a bash script. I am looking for this to use as part of a larger bash script that captures Video. The script sets up a bunch of parameters for DVgrab, and one of the parameters... (11 Replies)
Discussion started by: Starcast
11 Replies

8. Shell Programming and Scripting

tail display ....in perl

hi we have 3 servers and we have a script to monitor cpu usage of all 3 servers and writes into one file on one of the server where we monitor all those servers ( by doing tail -f filename ) so we decided to create script ( perl ) that will read values from this file and display it should be like... (2 Replies)
Discussion started by: zedex
2 Replies

9. UNIX for Dummies Questions & Answers

how to display line number for tail -f

Hi, Just wonder if there is any quick way to display line number when monitoring a log file with tail -f? (4 Replies)
Discussion started by: iengca
4 Replies

10. Shell Programming and Scripting

Tail-alike display of new files in directory

The system I work on, produces several kinds of status-files in a single directory. I would like to be able to see the files as they are added to this directory. I was wondering if it would be possible to get a "tail -f" alike view of the ls-command, in such a way that a newly added file is... (4 Replies)
Discussion started by: rschelkers
4 Replies
Login or Register to Ask a Question