Windows to UNIX issues


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Windows to UNIX issues
# 1  
Old 06-28-2010
Windows to UNIX issues

Hi, a script was used on Windows using MKS Toolkit. I'm trying to move it to a unix machine but it gets all errors. At first I had things like: syntax error: `in^M' unexpected

I still get these but I've been building it up slowly to try and find/remove problems. The current is: syntax error: `while' unmatched

It's not even letting me do a while loop. Anyone notice the problem?

Code:
while :
do
read ANS?"text..."
echo $ANS
esac
done

When I include:
Code:
trap "stty sane;echo '\n\n   *** Abnormal exit ***';exit" 1 2 3 4 5 6 7 8 9 15

I get: trap: bad signal 15

Thanks for any help.

The actual script looks like this: http://pastebin.ca/1891102

Last edited by Dird; 06-28-2010 at 10:55 AM..
# 2  
Old 06-28-2010
Code:
while :
do
  echo "text..."
  read ANS
  echo $ANS

done

That is an infinite loop, meaning it won't end unless the user presses ctrl/c or maybe ctrl/d.

You cannot trap signal 9. The error you have is that signal 15 is apparently not defined on your system.

Code:
kill -l

That is a lowercase -L will show you the signals on your system.
# 3  
Old 06-28-2010
while transfering the files from Windows using ftp set the transmission mode as "Ascii" instead of Binary in order to avoid ^M characters.
This User Gave Thanks to expert For This Post:
# 4  
Old 06-29-2010
Thanks expert...I set it to text transfer & it worked fine. Now I just have to go through figuring out why errors appear =]
Any idea why:
Code:
export ORCL_SQL="${HKTMP}/orcl.sql"
>$ORCL_SQL
[[ -s $ORCL_SVC ]] || return
cat << _EOT_ >$ORCL_SQL
...

Would lead to the error: cannot create /hk_9.2/tmp/orcl.sql: No such file or directory ?

I'm logged in as a super user~ (oracle) so it shouldn't be a privileges issue. The file already exists in the folder.
# 5  
Old 06-29-2010
Please post the output of:
Code:
id
ls -lad /hk_9.2
ls -ald /hk_9.2/tmp
ls -lad /hk_9.2/tmp/orcl.sql

# 6  
Old 06-30-2010
Hi,

Sorry that was a problem of not referencing correctly in the variables. Instead of currentfolder/deeperfolder like in Windows I had the variable just refer to the deeper folder. I now have a problem where it says: CAT: not found

I've googled but haven't found this problem and the line just points to a "}". Has anyone come across this error before & is able to suggest a reason?

Thanks for help.
# 7  
Old 06-30-2010
UNIX, unlike Windows, is case-sensitive concerning path names and commands. Check your script if you're perhaps calling the "cat" utility as "CAT".
This User Gave Thanks to pludi For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Issues with passwordless sftp2 from windows to Linux using F-Secure SSH Client

Hi, I am facing problems whie trying to do a passwordless ssh to Unix box from windows. Public key was generated using F-secure. When the F-secure client attempts it connects without password but when I try to use sftp2 in command line it prompts for password. I have tried several options and... (0 Replies)
Discussion started by: dhrajj
0 Replies

2. Windows & DOS: Issues & Discussions

Windows 7 64 bit issues with X11

Hi, I was hoping that somebody could assist me with the following issue. I recently installed a windows 7 64 bit professional on a desktop with following specs: Intel Core i7 3.4Ghz, 16 GB DDR3 RAM, AMD Radeon HD 6450. (Which was a upgrade of a xp 32 bit based system) Since I'm more... (10 Replies)
Discussion started by: kristofvdo
10 Replies

3. UNIX for Dummies Questions & Answers

Cygwin/X11 issues on Windows 7

Hi All, I recently upgraded to windows 7 and am therefore reinstalling cygwin/x11 after a long time. On XP I would start xterm from the startxwin.bat file. I am experiencing trouble starting with the startxwin executable which is the new recommended startup method as well as afew other... (2 Replies)
Discussion started by: ScKaSx
2 Replies

4. Solaris

Windows,Solaris, Red Hat triple boot issues

I have a pentium IV with 512 MB ram and 80 GB HDD. I first installed windows XP on the first primary partition, then Solaris on the second with 20 GB for the solaris partition, and when rebooted , the grub menu functioned as expected giving me the options to dual boot, so next I wanted to install... (3 Replies)
Discussion started by: saagar
3 Replies
Login or Register to Ask a Question