Search Results

Search: Posts Made By: jsmithstl
1,118
Posted By jsmithstl
basename...
basename '/u/dolfin/in/DOLFIN.PRL_100.OIB.TLU.001.D20110520.T040010'
DOLFIN.PRL_100.OIB.TLU.001.D20110520.T040010
1,021
Posted By jsmithstl
Try this: SQL> select * from emp; ...
Try this:
SQL> select * from emp;

EMPID FNAME SALARY
---------- ---------- ----------
101 Cero 4000
200 Arun 3000
459 Chris ...
Forum: UNIX and Linux Applications 05-14-2011
18,765
Posted By jsmithstl
This will work for you. shell script: $cat...
This will work for you.

shell script:
$cat dbms_output.ksh
#!/bin/ksh

ORA_DB=mydb
ORA_USER=myuser
ORA_PWD=$(cat ~/.pwd/.${ORA_USER}_${ORA_DB})

SQLFILE=~/scripts/sql/dbms_output.sql...
2,237
Posted By jsmithstl
The only potential problem I see is if you get an...
The only potential problem I see is if you get an error and the "ORA-" message contains a 1 (for example: ORA-01017 Invalid username or password), you would get a false positive.

You could just...
7,150
Posted By jsmithstl
$ cat check.sh #!/bin/bash function...
$ cat check.sh
#!/bin/bash

function check()
{
echo "num_args = $#"

for myarg in "$@"
do
echo "$myarg"
done
}

check 1 2

exit

output:

$ ./check.sh
11,192
Posted By jsmithstl
# # write the current crontab to a file. # ...
#
# write the current crontab to a file.
#
crontab -l > crontab.txt

#
# append the new command to the file.
#
echo "new command" >> crontab.txt

#
# replace the current crontab with the...
1,697
Posted By jsmithstl
If it's Oracle, you can also create a stored proc...
If it's Oracle, you can also create a stored proc using UTL_SMTP and send the emails from within Oracle. If you're interested, you can google it and find many examples of how to set it up.
13,870
Posted By jsmithstl
echo $a xxx.yyy.zzz.txt EXTN=$(echo $a | cut...
echo $a
xxx.yyy.zzz.txt
EXTN=$(echo $a | cut -d . -f 4)
echo "$EXTN"
txt
693
Posted By jsmithstl
Can you use example dates that actually exist in...
Can you use example dates that actually exist in your file and then show an example of the output you want extracted based on the data in your file.
Forum: Programming 12-01-2010
767
Posted By jsmithstl
Here's one way: $ cat avg.pl ...
Here's one way:


$ cat avg.pl
#!/usr/bin/perl
use strict;
my $line;
my $val;
my $school;
my $grades;
my $score;
my $total;
my $avg;
my $i;
open ( INFILE, "<avg.dat" ) or
die...
3,727
Posted By jsmithstl
You don't need to use expect, unless you just...
You don't need to use expect, unless you just want to...
#!/bin/ksh

set -A A_FILE file1 file2 file3 file4 file5 file6 file7 file8 file9 file10

i=0

while [ -n "${A_FILE[$i]}" ]
do
sftp...
2,556
Posted By jsmithstl
You can do this a couple different ways. Here's...
You can do this a couple different ways. Here's one that will do all the work in the script.

#!/bin/ksh

sqlplus -s /nolog <<-EOF
connect $USERNAME/$PASSWD@$DB

spool $LOGFILE

...
2,098
Posted By jsmithstl
Put a "set -x" before fname=$1 and when you...
Put a "set -x" before fname=$1 and when you execute the script,
it will show you the result of each command.

#!/usr/bin/sh

set -x

fname=$1
echo $fname

./blah.sh myfile.dat
+...
Forum: AIX 11-10-2010
26,540
Posted By jsmithstl
What version of Oracle are you running? Are you...
What version of Oracle are you running?
Are you using Enterprise Manager?
If not are you using statspack?
Have the database objects been analyzed lately?
Is it one query that you're having...
2,767
Posted By jsmithstl
Try setting the NLS_LANG on your unix box to same...
Try setting the NLS_LANG on your unix box to same as it is on the windows server. Once the file is created, change your NLS_LANG back to what it was and transfer the file and open it on your windows...
2,767
Posted By jsmithstl
What o/s was the client the data was inserted...
What o/s was the client the data was inserted from into the database?
What is the code page of that client?
What is the NLS_LANG setting for that client?
Was the data created on that client or...
802
Posted By jsmithstl
cat tawk.dat ABCD_1_0 ABCD_25_6 ABCD_326_12...
cat tawk.dat
ABCD_1_0
ABCD_25_6
ABCD_326_12
ABCD_10_3

awk -F_ '{ print $1"_"$2 }' tawk.dat
ABCD_1
ABCD_25
ABCD_326
ABCD_10
1,474
Posted By jsmithstl
sftp supports the use of a batch file containing...
sftp supports the use of a batch file containing a list of commands you want to execute once connected.
#!/bin/ksh

#
# Define the batch file.
#
SFTP_BAT_FILE=files_to_send.bat

#
# Remove...
Forum: Solaris 11-09-2010
2,497
Posted By jsmithstl
Change your cron entry to this and any errors...
Change your cron entry to this and any errors should show up in mc.log:
59 23 * * * /home/lng/script/move_and_compress_logs_update.sh > /home/lng/script/mc.log 2>&1
1,474
Posted By jsmithstl
Try this: cat tarray.ksh #!/bin/ksh set...
Try this:
cat tarray.ksh
#!/bin/ksh

set -A A_VAL one two three four five six seven eight nine ten

i=0

while [ -n "${A_VAL[$i]}" ]
do
echo "${A_VAL[$i]}"
(( i = i + 1 ))
done
...
2,698
Posted By jsmithstl
cat chk_file.ksh #!/bin/ksh FNAME=$1 ...
cat chk_file.ksh
#!/bin/ksh

FNAME=$1

case ${FNAME} in
+([0-9]) )
echo "${FNAME} is NUMBER"
;;
* )
echo "${FNAME} is CHARACTER"
;;
esac


./chk_file.ksh 1234 ...
2,767
Posted By jsmithstl
Have you tried setting NLS_LANG to...
Have you tried setting NLS_LANG to GERMAN_GERMANY.WE8ISO8859P1 before you run the database query to select the data out of the database? That should cause the proper characterset conversion to...
12,191
Posted By jsmithstl
Can you post your entire script and what shell...
Can you post your entire script and what shell you are using?
12,191
Posted By jsmithstl
#!/bin/ksh FROM_ITEM="40.1'1/16" echo...
#!/bin/ksh

FROM_ITEM="40.1'1/16"

echo "OLD: ${FROM_ITEM}"

#
# If you actually want two single quotes.
#
SINGLE_QUOTE=$(echo ${FROM_ITEM} | sed "s/'/''/")

#
# If you actually want...
12,965
Posted By jsmithstl
The ending EOF can be indented as long as it's...
The ending EOF can be indented as long as it's TABs and not spaces and you use "<<-EOF". Try this code, it should work for you. I'm using ksh.

if [ "${CHOICE}" -eq 1 ]; then
RET_CODE=$(...
Showing results 1 to 25 of 112

 

Featured Tech Videos

All times are GMT -4. The time now is 03:35 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy