Visit Our UNIX and Linux User Community

bunch of ^@^@^@^@^@^@^@^@'s in bash log file

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting bunch of ^@^@^@^@^@^@^@^@'s in bash log file
# 1  
Old 10-23-2009
bunch of ^@^@^@^@^@^@^@^@'s in bash log file

I have a bash script that has been running fine for months that scans a bunch of files and gives me a log file output, it has suddenly started putting 1.5M of a repeating sequence of ^@^@^@^@^@^@^@^@^@^@ on the first line of the logfile, is this a unicode problem I should be setting something in my bash script? I already had PATH issues after awhile of running (that I solved with your help, thanks!). Any suggestions?
# 2  
Old 10-23-2009

Find the problem in your script and fix it.
# 3  
Old 10-23-2009
um, thanks?
# 4  
Old 10-23-2009
Where do you see those characters? When you look at the file using vi/vim? If so, '^@' (one character, not two) is the representation of the NULL-byte. Example of this happening is when you truncate a file while there's still an open file-handle.
# 5  
Old 10-23-2009
It's an extremely long sequence of those 2 characters with no spaces between the 2 character pattern, only on the first line of the file when viewing with either vi or cat, it's almost like I'm not cleaning up from the last time I ran the script or something? I can't understand why it ran once a day for months and just now started doing this. The script takes >20 hours to run once.
# 6  
Old 10-23-2009
This is usually the case in VI when the line is "too long", or? (seen it on AIX, Solaris - but tried it on Linux, and that doesn't happen somehow!)

Previous Thread | Next Thread
Test Your Knowledge in Computers #1011
Difficulty: Easy
The number 128 in base 10 equals 10000000 in base 2.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script for looking in log file

Hello, I'm a beginner in shell scripting. I would really appreciate some help from the forum. I want to write a small script that will look in apache error log. If it finds the appropriate word. It would execute some commands. In my case the apache error log is situated in:... (2 Replies)
Discussion started by: ajaysingh99
2 Replies

2. Shell Programming and Scripting

Bash Script Closest Timestamp (LOG FILE)

Hi All, I need something where I could take the date from FILE1 and in this case the date is Thu Sep 10 13:48:42 EDT 2015 and I need it to match the closest PREVIOUS date in the log file FILE2 this means in this specific case it would be Thu Sep 10 2015 13:35:28. I only need the closest... (3 Replies)
Discussion started by: roberto999
3 Replies

3. Shell Programming and Scripting

BASH log file

hi .. am new to bash script.. #!/bin/bash logfile = "${HOME}/log/test.log" ./ echo " script over " can anyone telme hw to set the logfile ?? the above code calls the and echo statement gets printed in cmd prompt, but i could not see the log file . (8 Replies)
Discussion started by: Rahul619
8 Replies

4. Shell Programming and Scripting

I need to back up a bunch of files on a directory and save that file as the current date....

this is what i have to find the files modified within the past 24 hours find . -mtime -1 -type f -print0 | xargs -0 tar rvf "$archive.tar" however i need to save/name this archive as the current date (MM-DD,YYYY.tar.gz) how do i doo this (1 Reply)
Discussion started by: bugenhagen_
1 Replies

5. Shell Programming and Scripting

how to make my own file as a running log file in bash

Hi, I have written a small script from that iam appending the output to a file.If multiple users invoke the same script or if i invoke the same script n number of times (using &), the output file(ZZ/OUT) contains messup information. #!/bin/bash # echo "Hello" >> /tmp/ZZ/OUT sleep 10 echo... (4 Replies)
Discussion started by: blrguest
4 Replies

6. Shell Programming and Scripting

Logging ALL standard out of a bash script to a log file, but still show on screen

Is it possible to store all standard-out of a bash script and the binaries it calls in a log file AND still display the stdout on screen? I know this is possible to store ALL stdout/stderr of a script to a single log file like: exec 1>&${logFile} exec 2>&1 But running a script with the... (3 Replies)
Discussion started by: ckmehta
3 Replies

7. Shell Programming and Scripting

bash: color strings in log file

hello im looking for an easy way to color specific strings in text file. simple example: cat file1 acb 1234 qwer 5678 my goal: cat file1 (color the acb red and the 5678 blue) acb 1234 qwer 5678 cheers (2 Replies)
Discussion started by: modcan
2 Replies

8. Windows & DOS: Issues & Discussions

batch file--bunch of commands

I have a batch file that takes 2 parameters--source file location and target file location. I want to create another batch file that contains all the commands with the file locations so that I dont have to enter the ifnromation every time individually. For eg: to execute command com1.bat... (3 Replies)
Discussion started by: alfredo123
3 Replies

9. Shell Programming and Scripting

Bash tail monitor log file

Hi there, I have a problem here that involves bash script since I was noob in that field. Recently, I have to monitor data involve in logs so I just run command tail -f for the monitoring. The logs was generate every hour so I need to quickly change my logs every time the new hour hits according... (2 Replies)
Discussion started by: kriezo
2 Replies

10. News, Links, Events and Announcements

what a bunch of idiots... (1 Reply)
Discussion started by: norsk hedensk
1 Replies

Featured Tech Videos