Search Results

Search: Posts Made By: jsmithstl
2,192
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,902
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
29,535
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...
3,095
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...
10,414
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
16,919
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...
2,040
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.
24,997
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
1,104
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
1,589
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...
4,493
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...
4,293
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,860
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
40,422
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...
3,366
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...
3,366
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...
1,249
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
2,258
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
3,132
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
2,258
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
...
3,611
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 ...
3,366
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...
22,004
Posted By jsmithstl
Can you post your entire script and what shell...
Can you post your entire script and what shell you are using?
22,004
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...
17,372
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

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