Search Results

Search: Posts Made By: SFNYC
2,006
Posted By SFNYC
You could parse the date like this $ cat...
You could parse the date like this

$ cat compare_dates.ksh
#!/bin/ksh

USERDATE="2/15/2012"
IFS=/
set -- $USERDATE
typeset -Z2 MONTH=$1
typeset -Z2 DAY=$2
YEAR=$3
MYDATE="$YEAR$MONTH$DAY"...
5,541
Posted By SFNYC
Well, make sure Open is not capitalized like...
Well, make sure Open is not capitalized like Corona688 mentioned.
Then take away the '\'.

open (F, "home/work/PerlWork/dataFile") or die "Could not open the file:$!";

That should get rid of...
11,595
Posted By SFNYC
In the future you may want to consider using the...
In the future you may want to consider using the Tie::File module which can access the lines of a disk file via a Perl array if you cannot read a file into memory because of its size.
87,390
Posted By SFNYC
What isn't working? Keep in mind that the dd...
What isn't working?
Keep in mind that the dd command will NOT translate Packed Decimal or Binary values properly. It will convert only text, human readable values.
1,126
Posted By SFNYC
Try using split instead of push. Something...
Try using split instead of push.

Something like

@arr = split /\s/, $_;
13,464
Posted By SFNYC
You can also try something like this: find ....
You can also try something like this:

find . -type f -name "*" -exec cat >> newfile {} \;
6,368
Posted By SFNYC
You are close. Try using sort -u
You are close.

Try using sort -u
2,618
Posted By SFNYC
This has been answered already at... bash -...
This has been answered already at...

bash - perl to remove lines from file - Stack Overflow (http://stackoverflow.com/questions/7821795/perl-to-remove-lines-from-file)
7,340
Posted By SFNYC
Try something like this: exec 3>&1 foo=$(...
Try something like this:

exec 3>&1
foo=$( { dialog --passwordbox "password" 10 30 1>&3; } 2>&1 )
exec 3>&-
echo "foo=$foo"
4,538
Posted By SFNYC
Perl Signal Handler
I was working on some Perl code that does signal handling and I came across this one liner and wasn't sure what it was doing.

local $SIG{__DIE__} = sub {$! = 2; die $_[0];};

I think the first...
37,311
Posted By SFNYC
Your PERL program inherits its environment from...
Your PERL program inherits its environment from the SHELL that spawned it, changing environment variables will only last for the duration of the PERL program.

At the shell prompt, if you echo...
4,328
Posted By SFNYC
What database are you using? There may be a way...
What database are you using? There may be a way to code the SQL to return you some count or indicator when no rows are returned from your SELECT.

There is also a method called 'rows', but it does...
4,107
Posted By SFNYC
This method will not work if the file has comp...
This method will not work if the file has comp and comp-3 fields.

There is a Perl Module that should be able to do it for you.

Convert::IBM390 - search.cpan.org...
116,354
Posted By SFNYC
UTL_FILE won't work if his database is running on...
UTL_FILE won't work if his database is running on a different machine than his shell script.

Try this.

$ cat use_oracle_proc.ksh
#!/bin/ksh

run_sql()
{
$ORACLE_HOME/bin/sqlplus -S...
29,201
Posted By SFNYC
If you are expecting output from a...
If you are expecting output from a dbms_output.put.line command, make sure you have SET SERVEROUT ON amongst your sqlplus commands.
5,387
Posted By SFNYC
Interesting. It wasn't working for me on Linux...
Interesting. It wasn't working for me on Linux using

$ echo $SHELL
/bin/ksh

$ echo $KSH_VERSION
@(#)PD KSH v5.2.14 99/07/13.2


So, is this version of KSH not POSIX-compliant?
5,387
Posted By SFNYC
What shell does that work for? It doesn't work...
What shell does that work for? It doesn't work for me in KSH.

$ FirstIN=001,002,003,004

$ echo $FirstIN
001,002,003,004

$ FirstINb=${FirstIN//,/ }
ksh: : bad substitution
7,595
Posted By SFNYC
In Korn Shell $ cat zerofill.ksh ...
In Korn Shell

$ cat zerofill.ksh
#!/bin/ksh

m=`date "+%m"`
pm=`expr $m - 1`
echo $pm
typeset -Z2 ZERO_FILLED_NEXT_DAY=$pm
echo "ZERO_FILLED_NEXT_DAY=$ZERO_FILLED_NEXT_DAY"

exit 0

$...
7,432
Posted By SFNYC
Do you have PERL installed on your system? There...
Do you have PERL installed on your system? There are some functions that I have come across that can give you what you are looking for.

$ cat /tmp/getpath.pl

#!/usr/bin/perl

use strict;...
6,337
Posted By SFNYC
If you have Perl and the Date::Manip module...
If you have Perl and the Date::Manip module installed you can try this:

$ perl -le 'use Date::Manip;print UnixDate(ParseDate("1st Monday in December 2009"), "%d");'
07

$ perl -le 'use...
11,472
Posted By SFNYC
Try this: my $force; my $dbh =...
Try this:

my $force;

my $dbh = DBI->connect("DBI:mysql:myDB","username","password",) or die $DBI::errstr;

my $sth = $dbh->prepare("SELECT forcewrite FROM table WHERE primac = '$primac") ||...
12,403
Posted By SFNYC
Three things: 1) Put back #!/bin/ksh 2) ...
Three things:
1) Put back #!/bin/ksh

2) You misspelled the ORACLE_SID environment var
RACLE_SID=DB01 should be ORACLE_SID=DB01

3) Don't use semi-colons!! Semi-colons are not comment...
12,403
Posted By SFNYC
Try this script as a test. You may need to add ...
Try this script as a test.
You may need to add
ORACLE_SID=DB01;
export ORACLE_SID;

to get it to work.

$ cat ./get_oracle_var.ksh
#!/bin/ksh

MYDATE='20091113'
echo "MYDATE=$MYDATE"
...
12,403
Posted By SFNYC
Try changing this to not have the double quotes: ...
Try changing this to not have the double quotes:

select is_Regrade_order from portal.order where number = '"$orders"';

to

select is_Regrade_order from portal.order where number = '$orders';
3,650
Posted By SFNYC
You should always have use strict; use...
You should always have

use strict;
use warnings;

in your code.

Once there, listen to their error & warning messages and clean them up.

"Use of uninitialized variable in line number so...
Showing results 1 to 25 of 110

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