I'm working on one Unix shell sript that will actually extract a column data from Oracle table using sqlplus and writes onto a file. I'm getting this error when executing the shell script:
rpt.ksh[156]: ^JScott: not found
Below is the code in the shell script:
The query in the Shell script would retrieve one value i.e Scott
I have executed the query in SQLPLUS editor and I could see o/p being displayed.
Looks like an issue in writing the column value(special character getting appended i.e ^J) onto the text file by the shell script.
Please suggest.
Thanks in Advance.
Regards,
Venkat
Can you please suggest?
Fun Fact:
Quote:
An essential feature of programming is the ability to use a name or a label to refer to some other quantity: such as a value, or a command. This is commonly referred to as variables.
Variables can be used, at the very least, to make code more readable for humans:
Being the first word in the line, the shell will try to execute the result of the command substitution.
Fun UNIX Fact
Quote:
Command substitution allows the output of a command to replace the command itself. Command substitution occurs when a command is enclosed as follows:
$(command)
or
`command`
Bash performs the expansion by executing command in a subshell environment and replacing the command substitution with the standard output of the command, with any trailing newlines deleted. Embedded newlines are not deleted, but they may be removed during word splitting. The command substitution $(cat file) can be replaced by the equivalent but faster $(< file).
When the old-style backquote form of substitution is used, backslash retains its literal meaning except when followed by ‘$', ‘`', or ‘\'. The first backquote not preceded by a backslash terminates the command substitution. When using the $(command) form, all characters between the parentheses make up the command; none are treated specially.
Command substitutions may be nested. To nest when using the backquoted form, escape the inner backquotes with backslashes.
If the substitution appears within double quotes, word splitting and filename expansion are not performed on the results.
Hi ,
I am a newbie to shell scripting. I am getting the error on AIX machine
/tadfdc_setup_fed.sh: +: not found
Here tadfdc_setup_fed.sh is script which works fine on Linux Machine. But gives error on AIX (1 Reply)
hi guys can you please help me i have the following script to load to a database but when i execute it...its saying Check_Process: not found
#!/bin/ksh
##-To load Oracle user profile
##./monitor_io.ksh
##./test.ksh
SCP_DIR=/export/home/yani_m/scripts
... (9 Replies)
I am trying to run a unix script in my home directory.Snippet below
echo "`date '+%Y%m%d_%H%M%S'` Getting ProductList.dat"
if ( -f $DIR/ProductList.dat) then
cp $DIR/ProductList.dat MigratedProductList.dat
else
echo "`date '+%Y%m%d_%H%M%S'`ProductList.dat does not exist; Processing... (4 Replies)
How to use Mailx command in unix shell script, its throwing below error
#!/bin/ksh
let x=3
If ; then
mailx -s “ $x is greater than 2” example@gmail.com << EOF
This is the message body
EOF
fi
its throwing error as syntax error at EOF... (10 Replies)
i am having a weird error on mac os x running some shell scripts. i am a complete newbie at this and this question concerns 2 scripts. one of which a friend of mine wrote (videochecker.sh) a couple weeks ago and it's been running fine on another machine.
then last week i wrote capture.sh and it... (2 Replies)
Hi All,
I am trying to run a script to FTP files from one UNIX server to another UNIX server. Actually I can able to FTP file successfully by manually or paste whole script at prompt. But when I am trying to run script it is giving error.
Please let me know the cause.
#!/bin/sh... (3 Replies)
Hi,All
I wrote below script(Example1.sh) and i ran but i got error. it's excuted yesterday.
SYSTEM_TIME=`date '+%H:%M:%S'`
CMP_LOG_TIME=`head -1 runcmp-HINET.log`
CMP_ENDED1=`grep 'HINET CMP ended' runcmp-HINET.log`
CMP_ENDED2=`echo "HINET CMP ended"`
CMP_FAILED2=`echo "HINET CMP... (2 Replies)
Hi,All
I wrote below script(Example1.sh) and i ran but it giveing error. it's excuted yesterday.
SYSTEM_TIME=`date '+%H:%M:%S'`
CMP_LOG_TIME=`head -1 runcmp-HINET.log`
CMP_ENDED1=`grep 'HINET CMP ended' runcmp-HINET.log`
CMP_ENDED2=`echo "HINET CMP ended"`
CMP_FAILED2=`echo "HINET... (2 Replies)