BASH script outputting strange file formats


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting BASH script outputting strange file formats
# 8  
Old 08-17-2011
I worked with cygwin intensively enough some time. I have never had problems like this. Now I don't have it on my windows boxes so I can't check.
# 9  
Old 08-17-2011
Ok thanks for the help anyway. Appreciate it.
# 10  
Old 08-17-2011
Seems like some extra invisible characters at the end of line. Dump (cat -A or od) your script.
# 11  
Old 08-17-2011
Quote:
Originally Posted by binlib
Seems like some extra invisible characters at the end of line. Dump (cat -A or od) your script.
Sorry this is going to sound a bit simple, but im asuming cat -A or the od would go after the egrep, like a flag? In otherwords where do I put that into my script?Smilie
# 12  
Old 08-17-2011
I was not talking about changing your script but rather dumping your script. In your terminal, run "cat -A your-script-file" or "od -c your-script-file".
# 13  
Old 08-17-2011
Quote:
Originally Posted by binlib
I was not talking about changing your script but rather dumping your script. In your terminal, run "cat -A your-script-file" or "od -c your-script-file".
Ok I get you now, what should I be looking for or doing after that?
# 14  
Old 08-18-2011
Any characters which shouldn't be there.

Windows editors like Notepad have a habit of adding carriage-returns to the end of every line, things which UNIX doesn't need in a text file and so considers part of the text.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ubuntu 16 Bash strange output

Hello, I work in Ubuntu 16.04, I am new to Bash and something is wrong with my script, please help. I have a few hundreds of subjects data (like subj003.nii.gz, subj012.nii.gz etc. up to subj567.nii.gz) in a directory /usr/afewmoredirectories/subjects. I may run for each subject a command... (5 Replies)
Discussion started by: lim-lim
5 Replies

2. Shell Programming and Scripting

Need to check the file formats

Hi, I want to check the incoming files whether the file is Mac file or dos/windows file in unix shell script. Sometimes client is posting Mac file and sometimes it is dos file. Could you please help me how to determine/check whether the file is Mac or dos. Help in advance Thanks (4 Replies)
Discussion started by: lkeswar
4 Replies

3. Shell Programming and Scripting

Bash string variable outputting incorrectly

Hello All, I am learning BASH scripting and I would appreciate any help with a small problem I am having... I am writing a script that builds a simple hosts file for DNS reasons related to a piece of software called netdb by parsing another application's config files for IP's and their... (4 Replies)
Discussion started by: Wesley545
4 Replies

4. UNIX for Dummies Questions & Answers

outputting set -x to file

I need to enable set -x in my croned script as at times the script is not returning all data that it should be. This only happens intermittently and as such I would like a means of being able to check what goes wrong. My question is how to output the debug of set -x to file? (1 Reply)
Discussion started by: rob171171
1 Replies

5. Shell Programming and Scripting

ksh script to create a generic csv file from different source formats

Hi all, I have a requirement to create a "superset" file out of a number of different sources with some different and some same columns. We intend to have a manually updateable SuperSetCols.csv which would look like "ColA","ColB","ColC","ColD","ColE","ColF","ColG" so someday we may add... (3 Replies)
Discussion started by: Leedor
3 Replies

6. Shell Programming and Scripting

Strange error in bash script

Howdy all, I have a scritp that does a sqldump. But for some goofy reason, a certain part of it behaves uber strange. It does a daily dump of my sql, according to parameters I enter in hardcode. The script is: #!/bin/bash APP_NAME="app_com_site" wikiname="wiki_com_site" ... (8 Replies)
Discussion started by: saariko
8 Replies

7. Shell Programming and Scripting

Script Assistance - Outputting to file with Awk

I'm trying to take a list of domains, find out the MX resolve it to IP then find out what the NS is and output the contents to a new file. The only problem i'm having is when checking the Ip or host of the MX i can only get it to print the column with the MX record and the results of the host... (1 Reply)
Discussion started by: spartan22
1 Replies

8. Shell Programming and Scripting

simple count script outputting mass errors

script outputting cant find anything wrong with the script either... : #!/bin/sh #count execution script time=0 while do if then time=`expr $time + 1` if then echo "The current tick is 100" fi fi (2 Replies)
Discussion started by: aspect_p
2 Replies

9. Shell Programming and Scripting

expr not outputting properly.. bsd sh script

When i run sh -x test.sh, expr outputs x=expr $x + 1 instead of doing the arithmetic.. been working on this overnight.. and its being a pain in the arse if you ask me.. :confused::confused: #!/bin/sh #script for downloading numerical filenames chap=1 p=1 count=0 x=1 while do if ... (2 Replies)
Discussion started by: aspect_p
2 Replies
Login or Register to Ask a Question