Visit Our UNIX and Linux User Community

Strange behavior on one of my server

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Strange behavior on one of my server
# 1  
Old 11-18-2013
Strange behavior on one of my server

I am not sure what is wrong, but I have some strange behavior when printing things out.

I do create a file with only one word test, no space, no new line etc.

nano file<enter>
test<ctrl x>y<enter>

Server 1 gets (fail)
awk '{print "+"$0"*"}' file

Server 2 gets (OK)
awk '{print "+"$0"*"}' t

What is going on with my Server1?
# 2  
Old 11-18-2013
Could you dump your file with od -c command ?
I expect your file on server that fail content a '\r':
$ od -c t
0000000   t   e   s   t  \n
$ awk '{print "+"$0"*"}' t

$ od -c t
0000000   t   e   s   t  \r  \n
$ awk '{print "+"$0"*"}' t

# 3  
Old 11-18-2013
You are correctly. Smilie
Why does one server add the \r but not the other.
I do the same on both server, using nano to create a file.
When I do test again, I am not able to reproduce the problem.
# 4  
Old 11-18-2013
Might you have uploaded the 'test' file from a windows machine at one point? That would create it as a Windows text file with carriage returns.
# 5  
Old 11-18-2013
Or, do you have different configuration files on the two servers?
# 6  
Old 11-19-2013
What type of configuration files?
File is not uploaded, its created using nano via SSH
# 7  
Old 11-19-2013
Not sure. Sth like .nanorc in /etc or in your home directory?

Previous Thread | Next Thread
Test Your Knowledge in Computers #885
Difficulty: Easy
Denial of service attacks (DoS) are designed to make a machine or network resource unavailable to its intended users.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Strange Ctrl+C behavior

Hello All, I have a strange issue. I've created a shell script which connects to RMAN (Oracle Recovery Manager) and executes full DB backup. I then executed this script with nohup and in the background: $ nohup > logfile.log 2>&1 &The issue is that when I tried to take a look into... (6 Replies)
Discussion started by: JackK
6 Replies

2. AIX

Strange behavior with tar

I am trying to create an archive using tar. I am specifying a list of directories using the -L option. For testing purposes I created a simple directory structure: /backup/test /backup/test/test1 /backup/test/test2 The file specified by the -L option, named files.txt, contains:... (8 Replies)
Discussion started by: judykstra
8 Replies

3. AIX

Strange memory behavior

Hello together, i have a strange memory behavior on a AIX 7.1 System, which i cannot explain. The Filesystem-Cache will not be grow up and drops often after few minutes. I know if a file was deleted, that the same segment in the FS-Cache will also be cleared. But i am not sure if this is the... (8 Replies)
Discussion started by: -=XrAy=-
8 Replies

4. Red Hat

strange mail behavior

Hi I have script to to take backup and send mail to a group once a day. One strange behavior I have observed recently is that most of the time the mail we receive is fine . But someday it just sends out mail without any subject with undisclosed recipients. I dont know how to find the cause... (0 Replies)
Discussion started by: ningy
0 Replies

5. Ubuntu

Ubuntu strange behavior

It is so till login screen. I mean that when I boot my computer, Ubuntu shows a splash screen with mouse instead of Ubuntu logo and in the login screen it shows XUbuntu login screen... It began when I upgraded to previous kernel, I suppose, but I'm not sure... I can't say that it annoys me very... (6 Replies)
Discussion started by: Sapfeer
6 Replies

6. Programming

Strange behavior in C++

I have the following program: int main(int argc, char** argv){ unsigned long int mean=0; for(int i=1;i<10;i++){ mean+=poisson(12); cout<<mean<<endl; } cout<<"Sum of poisson: "<< mean; return 0; } when I run it, I get the... (4 Replies)
Discussion started by: santiagorf
4 Replies

7. Shell Programming and Scripting

nawk strange behavior

Dear guys; when deleting repeated lines using nawk as below ; Why the below syntax works? nawk ' !a++' infile > outfile and when using the other below syntax the nawk doesn't work? nawk ' { !a++ } ' infile > outfile or nawk ' { !a++ } ' infile > outfile BR (4 Replies)
Discussion started by: ahmad.diab
4 Replies

8. Shell Programming and Scripting

Very Strange Behavior for redirection

I have searched far and wide for an explanation for some odd behavior for output redirection and haven't come up with anything. A co-worker was working on old scripts which have run for years and embedded in their code were output redirects which worked for the script during execution and then... (5 Replies)
Discussion started by: cahook
5 Replies

9. UNIX for Dummies Questions & Answers

Strange Behavior on COM2

Hi, I have a problem with a new touch screen controller that I am trying to use on a SCO 3.0 system. THe touch screen controller only wants to talk at 9600baud. I have updated /etc/inittab per the manual and also edited /usr/lib/event/devices to use 9600 baud. The only way I can get the... (0 Replies)
Discussion started by: Elwood51
0 Replies

Featured Tech Videos