- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Not An Identifier
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2003 11:19 PM
05-30-2003 11:19 PM
Not An Identifier
I'm suppose to run a cron job that reads and executes the script: sh_download.sh. The content of the script is:
#!bin/sh
###############################################
# Shell Script : sh_download.sh
# Purpose : To schedule all the download job # with FTP to get the data file from NT server
# By:Ryan
# To schedule : Create cron job for
#sh_download.sh,< change the mode>
###############################################
LOCAL_FILES="/home/db01"
BCK_FILES="/home/db01/backup"
ORACLE_HOME="/orasw2/appl/oracle/product/8.1.7"
export ORACLE_HOME
DATE1=`date +"%d%m%Y%H%M%S"`
DATE=`date +"%y%m%d%H%M"`
echo $DATE
echo $DATE1
sqlplus -s scott/tiger@test << !
@ $LOCAL_FILES/mth_pdb.sql
exit
!
sh $LOCAL_FILES\unix_to_mth.sh
When the above job is run, there are 2 errors:
/home/sodb01/so/mha/sh_download.sh[10]: ^M: not found
/home/sodb01/so/mha/sh_download.sh[14]: ORACLE_HOME^M: This is not an identifier
Can someone help to explain the errors? And what is ^M
Many thanks
Ryan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2003 11:37 PM
05-30-2003 11:37 PM
Re: Not An Identifier
the ^M indicates that the file has been ftp'ed from Windows/NT without char conversion; probably done with ftp "bin-command". You can convert the chars of the script by running the command dos2ux like this:
# dos2ux sh_download.sh >new_sh_download.sh
However, you can also ftp the script again. I assume that you have given the ftp command "bin". Do not, as unix should be able to figure out the correct conversion itself.
You should also correct the first line:
#!bin/sh
should probably be:
#!/bin/sh
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2003 11:39 PM
05-30-2003 11:39 PM
Re: Not An Identifier
The ^M is a control character, normally seen when you ftp a file from a Windows OS to a Unix OS. It appears your script has been ftp'd in this way. To remove these from the script use:
# cat sh_download.sh|sed -e 's/.$//' > sh_download_new.sh
You can then test the new script and if it works move it into place. Use a tool like vi on the original script to see the control character at the end of each line.
A brief discussion of this can be found in this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xd39419434a69d711abdc0090277a778c,00.html
Regards,
James.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2003 12:26 AM
05-31-2003 12:26 AM
Re: Not An Identifier
1. So is the ^M that's causing the 2 errors which I have mention? Will removing it solve the errors? Why [10] and [14](not an identifier) has an error?
2. I thought the ^M serves a purpose, that is to act as an automtic
thanks!
Ryan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2003 12:36 AM
05-31-2003 12:36 AM
Re: Not An Identifier
To convert those files to unix format
use
#dos2unix source-file desti-file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2003 09:17 AM
05-31-2003 09:17 AM
Re: Not An Identifier
This is a 2way street. Transfer and ASCII file from Unix to a PCwindows system using BINARY and Notepad will display black squares for each LF character. Now Wordpad and Word4Windows will APPEAR to display correctly but the lone LF character is called a soft carriage return which has special meanings within the word processors.
SO, ALWAYS use ASCII when transferring ASCII files--ftp eliminates the incompatibility issues.
And the correct path for sh (the POSIX shell) is not /bin/sh, it is /usr/bin/sh (been that way for a decade in HP-UX). The reason that /bin/sh works is that there is a transition link at /bin (which is not a directory at all) pointing to /usr/bin. Same with /lib. Unix systems conforning to V.4 filesystem layouts follow this convention. But most important, symlinks happen to be the default--they *WILL* change to an optional feature in future releases (HP has stated this several times). Time to upgrade your script headers...
Bill Hassell, sysadmin