Gibberish when unzipping files in Putty


 
Thread Tools Search this Thread
Operating Systems Solaris Gibberish when unzipping files in Putty
# 1  
Old 02-17-2010
Gibberish when unzipping files in Putty

Hello. I'm ingesting files from one system (db hosted on Solaris 10) to another (db hosted on Solaris 9). Files come in zipped, and contain various txt files, which I'll use SQL*Loader to load.

The unzipping, loading etc. is all handled in a ksh shell script. Sadly, we use Putty for all our unix work (and that's part of the problem I think). The files normally arrive at the target host in pairs. When I try to unzip the files, a load of gibberish is sent to the screen. Like this:

Code:
mv: cannot access C/$tf_peo_deals_1to1_20100121080000.txtíZ[oÛ8~`þ{2HÝ][m8¶×v:Í¡ØL¢©-²ü~¤dù¶ÈNçO:<¢(òð|<Wi:n&íδ7Ìz]9Åe9÷®f_OãñdÖG3ê§ÎÞh8

(that's only a fragment. The whole thing is like Lord of the Rings.)

This is a problem as we have associated trace files which our ops guys need to look at, and they're filling up to monstrous sizes with these strange characters. At a guess, I'd say this is due to differing character sets on the source and target machines, but I haven't a clue about how to resolve this.

Has anyone seen this before? Any feedback would be gratefully received.

Strangely, I don't see this problem when there is just one file to process, which is sad, as that's never the case.

Thanks,
Ray

Last edited by pludi; 02-17-2010 at 11:44 AM.. Reason: code tags, please...
# 2  
Old 02-18-2010
Can you go into the directory where the files reside and do a ls -l on the zip files?
# 3  
Old 02-18-2010
Quote:
Originally Posted by Ray Harilal
The unzipping, loading etc. is all handled in a ksh shell script. Sadly, we use Putty for all our unix work (and that's part of the problem I think).
PuTTY's a pretty good terminal actually. I'd suspect your shell script first.

Are you using putty to connect to a serial terminal by any chance? Or are you making network connections?
# 4  
Old 02-18-2010
@incredible: yes, the ls -l looks fine:

Code:
-rw-r--r--   1 fed_cntl appl        6326 Feb 18 08:56 tf_mna_deals_ingest_20100104080000.zip
-rw-r--r--   1 fed_cntl appl        9235 Feb 18 08:56 tf_peo_deals_ingest_20100121080000.zip
-rw-r--r--   1 fed_cntl appl          46 Feb 17 14:43 xyz.zip

The issue only seems to happen when I unzip more than one file, then all kinds of stuff gets sent to the screen (and my output files).

---------- Post updated at 09:11 AM ---------- Previous update was at 09:04 AM ----------

@Corona688: we're using Putty to make network connections. Does that narrow down the potential cause of the issue?
# 5  
Old 02-18-2010
Can you capture this output now once all the below steps have been executed?Thx
Login as the user
chmod 744 *.zip
unzip \*.zip > /dev/null
# 6  
Old 02-18-2010
Yes, please see below. Please note that xyz.zip is not a real zip file, but a file I put there for test purposes. The unzip command seems to have worked ok.

Code:
dtcd-cnrnda1:fed_cntl $ chmod 744 *.zip
dtcd-cnrnda1:fed_cntl $ unzip \*.zip > /dev/null
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
note:  xyz.zip may be a plain executable, not an archive
2 archives were successfully processed.
1 file had no zipfile directory.
dtcd-cnrnda1:fed_cntl $ ls
tf_mna_deals_1to1_20100104080000.txt         tf_peo_deals_1to1_20100121080000.txt
tf_mna_deals_acqtech_20100104080000.txt      tf_peo_deals_audit_20100121080000.txt
tf_mna_deals_afinadv_20100104080000.txt      tf_peo_deals_delete_20100121080000.txt
tf_mna_deals_alegal_20100104080000.txt       tf_peo_deals_eventhist_20100121080000.txt
tf_mna_deals_consid_20100104080000.txt       tf_peo_deals_ingest_20100121080000.zip
tf_mna_deals_delete_20100104080000.txt       tf_peo_deals_law_20100121080000.txt
tf_mna_deals_ingest_20100104080000.zip       tf_peo_deals_mgr_20100121080000.txt
tf_mna_deals_source_20100104080000.txt       tf_peo_deals_price_20100121080000.txt
tf_mna_deals_targetstock_20100104080000.txt  tf_peo_deals_source_20100121080000.txt
tf_mna_deals_tfinadv_20100104080000.txt      xyz.zip
tf_mna_deals_tlegal_20100104080000.txt



---------- Post updated at 09:56 AM ---------- Previous update was at 09:44 AM ----------

------------------------------------

In fact, looping through the directory contents seems to cause the error too, consider this simple script:

Code:
#!/usr/bin/ksh
export FEEDS=/opt/appl/feeds
export inputDir=${FEEDS}/nda_tf_deals
for filename in $(ls ${inputDir}/arrival/ | grep -v "tf_"*.zip);
do
   echo "Filename ${filename} is not valid - moving to unproc directory"
done
for filename in $(ls ${inputDir}/arrival/tf_*.zip);
do
   echo "Filename ${filename} is valid - so extract txt files from zip file"
done

which, when given the directory contents:

Code:
test.ksh
tf_mna_deals_ingest_20100104080000.zip
tf_peo_deals_ingest_20100121080000.zip
xyz.zip

should output messages saying the tf_* files are valid, and the others aren't. Instead, I get this (fragment):

Code:
Filename Po6<X2¹Íî is not valid - moving to unproc directory
Filename C/$tf_peo_deals_1to1_20100121080000.txtíZ[oÛ8~`þ{2HÝ][m8¶×v:Í¡ØL¢©-²ü~¤dù¶ÈNçO:<¢(òð|<Wi:n&íδ7Ìz]9Åeç"&r_OãñdÖG3ê§ÎÞh8{Û9÷®fç&Óöôz"û½É´7x7¸s=îMofÓ,ÛÁðzÐgÝö4ñQÜÆÝYo2¹6}              >Hg:7JT]4âq'Ýv.¯G³Q{\ is not valid - moving to unproc directory
Filename Õôè{ðáS{½Xrö¾Ý¿q4í7ýXQod¨Þà}ñcÍón>} is not valid - moving to unproc directory
Filename X:±üñf;sB6 is not valid - moving to unproc directory
Filename +³m7ôä@v is not valid - moving to unproc directory

# 7  
Old 02-18-2010
But in your script, I don't see anywhere that you're trying to "unzip" ??
In your do loop, can you try omitting the "ls" command?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unzipping a file which has multiple folders and each folder has the files with same name in it

Hi, I have a zipped file a.zip. This has got multiple folders in it say x and y. x contains a.txt and y contains a.txt. Is it possible to unzip this file and have the 2 files extracted and rename them to unique names. Thanks in advance. (1 Reply)
Discussion started by: arunkesi
1 Replies

2. Windows & DOS: Issues & Discussions

Issue: Unzipping file containing files/folders with a similar name

Hi, I have a zip file created on a Linxux server that I need to extract on a Windows machine... The zip file containing folders with the same name but they each have a different case, one if camel case and the other is just capitalised. When I extract using 7zip, I get prompted if I want to... (3 Replies)
Discussion started by: muay_tb
3 Replies

3. Shell Programming and Scripting

Finding a text file from a group of zip files without unzipping

HI , There are more than 100 zip files in a directory and i wanted to see if there is a max1157.txt file in any of the zip files without actually unzipping them. Could you please help. Thanks in Advance. Karthik. (6 Replies)
Discussion started by: karthikk0508
6 Replies

4. UNIX for Dummies Questions & Answers

view gzipped files with name file.gz.$DATE on a Solaris box (without unzipping first)

Hi Howto view gzipped files with name file.gz.$DATE on a Solaris box (without unzipping first) $ ls -lrt total 4477 -rwxrwxr-x 1 oracle dba 569745 Apr 4 19:45 4_person2profileCon.txt.gz.04.04.11* -rwxrwxr-x 1 oracle dba 3783 Apr 4 19:45... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

5. UNIX for Dummies Questions & Answers

Unzipping windows zip files on Sun sparc workstation

I've got to install and compile some C++ source code that has been developed on a windows box on a Sun sparc workstation. Can I simply e-mail myself some windows zip files and then download and unzip them on the sparc box? I've tried this on a linux openSUSE machine and it works fine but I'm not... (4 Replies)
Discussion started by: achartley
4 Replies

6. UNIX for Dummies Questions & Answers

Unzipping multiple files

I have some 10 to 20 .ZIP files in a given UNIX Directory and how to extract all the files into a one output file and preferably a .GZ file. Pls suggest. (2 Replies)
Discussion started by: aravindj80
2 Replies

7. UNIX for Dummies Questions & Answers

Unzipping multiple password-protected files

I am trying to unzip ~150 files on a SUN server in Unix via a telnet program (PuTTy), so I am restricted (I believe) to single-line command functions. All of the files are password protected, and each one contains three files. Is there a way to automate the process? I have tried 7z, but that only... (0 Replies)
Discussion started by: Davman
0 Replies

8. Shell Programming and Scripting

Unzipping files <password protected>

Hie Friends, I need your help once again. I have 77 “password protected” winzip files in linux/unix server. I want to decrypt it through an automated script. Password of every file is same and it is mhd*tt. Please help me. Usually I unzip it as follows, manually one by one. unzip <file name> ... (6 Replies)
Discussion started by: anushree.a
6 Replies

9. Shell Programming and Scripting

Greping from zipped files without unzipping

I have more than 500 gzipped files in a directory. I have one lookup file in the same directory with 200 key values. I need to get the name of the gzipped file which have any of these 200 key values. Here my criteria is do not unzip the files due to space constraint. Any suggestion? (3 Replies)
Discussion started by: kanu_kanu
3 Replies
Login or Register to Ask a Question