Visit The New, Modern Unix Linux Community

Search Results

Search: Posts Made By: SFNYC
1,145
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"...
3,839
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...
8,444
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.
61,590
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.
661
Posted By SFNYC
Try using split instead of push. Something...
Try using split instead of push.

Something like

@arr = split /\s/, $_;
7,643
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 {} \;
3,971
Posted By SFNYC
You are close. Try using sort -u
You are close.

Try using sort -u
1,852
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)
5,479
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"
3,210
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...
29,613
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...
2,985
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...
2,928
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...
94,866
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...
23,690
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.
3,244
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?
3,244
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
6,340
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

$...
3,601
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;...
4,573
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...
9,277
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") ||...
11,023
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...
11,023
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"
...
11,023
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';
2,921
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

 

Featured Tech Videos

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