remove hidden messages


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting remove hidden messages
# 1  
Old 11-17-2006
remove hidden messages

When I print (cat) my log file, the following shows up

[00:15:09 17/11/2006] Executing sftp ...
sftp> lcd /home/abc
/home/abc
sftp> put test.xml
test.xml | 20MB | 620kB/s | TOC: 00:00:33 | 100%
sftp> quit
[00:15:46 17/11/2006] test.xml transferred

then I try to grep "100%" from this file where I got "grep: 0652-226 Maximum line length of 2048 exceeded."
So I did a "cat -v" on my log file which give me

[00:15:09 17/11/2006] Executing sftp ...
sftp> lcd /home/abc^M
/home/abc^M
sftp> put test.xml^M
^Mtest.xml | 576kB | 576kB/s | ETA: 00:00:34 | 2%^Mtest.xml | 960kB | 480kB/s | ETA: 00:00:40 | 4%^Mtest.xml | 1.4MB | 480kB/s | ETA: 00:00:39 | 7%^Mtest.xml | 1.9MB | 480kB/s | ETA: 00:00:38 | 9%^Mtest.xml | 2.4MB | 486kB/s | ETA: 00:00:37 | 11%^Mtest.xml | 2.8MB | 485kB/s | ETA: 00:00:36 | 14%^Mtest.xml | 3.3MB | 485kB/s | ETA: 00:00:35 | 16%^Mtest.xml | 3.8MB | 480kB/s | ETA: 00:00:34 | 18%^Mtest.xml | 4.2MB | 480kB/s | ETA: 00:00:33 | 21%^Mtest.xml | 4.7MB | 480kB/s | ETA: 00:00:32 | 23%^Mtest.xml | 5.1MB | 477kB/s | ETA: 00:00:31 | 25%^Mtest.xml | 5.6MB | 480kB/s | ETA: 00:00:30 | 28%^Mtest.xml | 6.1MB | 480kB/s | ETA: 00:00:29 | 30%^Mtest.xml | 6.5MB | 475kB/s | ETA: 00:00:29 | 32%^Mtest.xml | 6.9MB | 469kB/s | ETA: 00:00:28 | 34%^Mtest.xml | 7.3MB | 470kB/s | ETA: 00:00:27 | 36%^Mtest.xml | 7.8MB | 471kB/s | ETA: 00:00:26 | 39%^Mtest.xml | 8.3MB | 471kB/s | ETA: 00:00:25 | 41%^Mtest.xml | 8.9MB | 478kB/s | ETA: 00:00:23 | 44%^Mtest.xml | 9.4MB | 482kB/s | ETA: 00:00:22 | 47%^Mtest.xml | 10MB | 486kB/s | ETA: 00:00:21 | 49%^Mtest.xml | 11MB | 492kB/s | ETA: 00:00:19 | 52%^Mtest.xml | 11MB | 498kB/s | ETA: 00:00:18 | 56%^Mtest.xml | 12MB | 509kB/s | ETA: 00:00:16 | 59%^Mtest.xml | 13MB | 521kB/s | ETA: 00:00:14 | 63%^Mtest.xml | 14MB | 537kB/s | ETA: 00:00:12 | 68%^Mtest.xml | 14MB | 548kB/s | ETA: 00:00:10 | 72%^Mtest.xml | 15MB | 561kB/s | ETA: 00:00:08 | 76%^Mtest.xml | 16MB | 570kB/s | ETA: 00:00:06 | 80%^Mtest.xml | 17MB | 578kB/s | ETA: 00:00:05 | 84%^Mtest.xml | 18MB | 588kB/s | ETA: 00:00:03 | 89%^Mtest.xml | 19MB | 597kB/s | ETA: 00:00:02 | 93%^Mtest.xml | 19MB | 603kB/s | ETA: 00:00:00 | 97%^Mtest.xml | 20MB | 620kB/s | TOC: 00:00:33 | 100%^M
sftp> quit^M
[00:15:46 17/11/2006] test.xml transferred

what I want to do is to verify whether the file is transferred successfully, hence "grep 100%", but it seems that there are many hidden messages which cause error, can anyone tell me whether I can remove these hidden messages? or is there any other way to verify?
# 2  
Old 11-17-2006
How about using scp instead of sftp? It should work anywhere sftp works, and you can just check it's return value instead of processing a logfile.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync - how to copy hidden folder or hidden files when using full path

Hello. I use this command : rsync -av --include=".*" --dry-run "$A_FULL_PATH_S" "$A_FULL_PATH_D"The data comes from the output of a find command. And no full source directories are in use, only some files. Source example... (2 Replies)
Discussion started by: jcdole
2 Replies

2. Shell Programming and Scripting

How to remove hidden backslash in multiple files?

Hi I have around 300 files in a folder. When I type ls -l I see the following Mouse.chr10_+_:101862321-101863928.maf Mouse.chr10_+_:101862322-101863928.maf Mouse.chr10_+_:101862323-101863928.maf But when I run my scripts, they couldn't recognise the filename because of hidden backslash like... (5 Replies)
Discussion started by: quincyjones
5 Replies

3. UNIX for Dummies Questions & Answers

List all directories hidden or not hidden

I want to list all directories hidden or not hidden. ls -ld */ => shows only not hidden directories so i guess the answer would be to add the a option to show all files ls -lad */ => not working :confused: ls -la | grep "^d" => works But I would like to know why I can't use ls -lad... (4 Replies)
Discussion started by: servus
4 Replies

4. UNIX for Dummies Questions & Answers

Hidden files

How to list out only the hidden files from a directory ? Thanks (4 Replies)
Discussion started by: pandeesh
4 Replies

5. Shell Programming and Scripting

Remove console messages of background programs

Hi all ! If I run Xterm in backgprund mode &, when it stops I get this annoying messages on console: Exit 15 xterm ... Exit 15 xterm ... How do can I remove this kind of ? Thanks ! (3 Replies)
Discussion started by: jerold
3 Replies

6. Shell Programming and Scripting

How to remove messages coming from UNZIP command?

Hello, I am writting a script, which gets folder and search for *.zip files in to it. If .zip files are available, then UNZIP all files into that folder only. Here is my code, for file in "$INPUT_FILE_FOLDER/"*.zip do unzip -d "$INPUT_FILE_FOLDER/" -oqq $file done If .zip files are... (2 Replies)
Discussion started by: Poonamol
2 Replies

7. Shell Programming and Scripting

How to remove the redundancy messages in a file

Hi I have a file in which there are lot of redundancy messages.. Like suppose i have the messages like the following in my file.. 45123|1|784tryr|uirirr|wagras|swyuyau|| 45123|1|784tryr|uirirr|wagras|swyuyau|| I need to remove the extra (45123|1|784tryr|uirirr|wagras|swyuyau||) and need... (1 Reply)
Discussion started by: grajesh_955
1 Replies

8. Shell Programming and Scripting

Finding Hidden files and protecting the folder containing hidden files from deletion

Hi. I have a script which is deleting files with a particular extension and older than 45 days.The code is: find <path> -name "<filename_pattern>" -mtime +45 -exec rm {} \; But the problem is that some important files are also getting deleted.To prevent this I have decide to make a dummy... (4 Replies)
Discussion started by: pochaw
4 Replies
Login or Register to Ask a Question