Search Results

Search: Posts Made By: MIA651
1,306
Posted By MIA651
0403-016 Cannot find or open the file in If Statement
Hi,

I am comparing the number of records in the .bad record from sql loader, if it is higher than the number passed in as an argument, the program should exit. However, I constantly receive the...
1,097
Posted By MIA651
Thanks, but this still hasn't solved the issue.
Thanks, but this still hasn't solved the issue.
1,097
Posted By MIA651
Passing a second argument
I am trying to pass a second argument like so:

if [[ $2 != "" ]] then
export ARG2=$2
else
message "Second argument not specified: USAGE - $PROGRAM_NAME ARG1 ARG2"
checkerror -e 2 -m...
1,436
Posted By MIA651
Unfortunately, I cannot access /etc/sudoers as...
Unfortunately, I cannot access /etc/sudoers as the file is owned by root and doesn't have permissions for others to read/edit.

What other option do I have to run a command as USER A as USER B. I...
1,436
Posted By MIA651
Running a command as another non-root user
Hi,

I am trying to run a command within my KSH script as another user due to permission issues, now both users are non root. I have tried the following command and was unsuccessful:

echo...
4,052
Posted By MIA651
Ok I have attached another zip file, both files...
Ok I have attached another zip file, both files have 6 records, and the desired output (prod_new.dat) has 4 records. In prod.dat there are 2 records with item numbers that do not exist in...
4,052
Posted By MIA651
Now, when I replace the item number (col 1-9), or...
Now, when I replace the item number (col 1-9), or replace the order of the items, those records were filtered out as well. They won't always be in the same order, or new items might come in. I just...
4,052
Posted By MIA651
Sorry for bothering you again, but this returned...
Sorry for bothering you again, but this returned 176 records out of 1885, the desired output would be 1882 records, as only 3 items have different department IDs between the two files.
4,052
Posted By MIA651
I have the two files zipped. When you unzip, you...
I have the two files zipped. When you unzip, you will see prod.dat and prod_last.dat, they are different. In records 1-3, have different department numbers (columns 361-369), all those 3 records with...
4,052
Posted By MIA651
It would be impossible to do so as there is a...
It would be impossible to do so as there is a limitation on the width when I try to post it. Any chance you can please explain the steps so I can try to edit it to suit my needs?
4,052
Posted By MIA651
Thanks again. I think there is a...
Thanks again. I think there is a misunderstanding, each "paragraph" in the file represents a record (1 line). So item is columns 1-9 and department is columns 361-369. Of course, I tried to...
4,052
Posted By MIA651
Thanks @vgersh99 Tried to do so but got the...
Thanks @vgersh99

Tried to do so but got the following error:

mia.awk: {: not found
mia.awk[2]: syntax error at line 2 : `(' unexpected



Can you please break down to me what is happening...
4,052
Posted By MIA651
Awk/sed/cut to filter out records from a file based on criteria
I have two files and would need to filter out records based on certain criteria, these column are of variable lengths, but the lengths are uniform throughout all the records of the file. I have shown...
4,267
Posted By MIA651
Thanks, tried the typeset -i approach and still...
Thanks, tried the typeset -i approach and still get the same failure:


+ typeset -i process_count= 0
+ [ 0 -ne 0 ]
/db/scripts/review_load.ksh[59]: test: argument expected
4,267
Posted By MIA651
The script is simply a standalone function that...
The script is simply a standalone function that is called by a ksh script with the first line "#!/usr/bin/ksh"
4,267
Posted By MIA651
I have changed it to include quotations around...
I have changed it to include quotations around the variable in the comparison and use an integer operator, per your suggestion, RudiC and still not working for me:

Code:


...
4,267
Posted By MIA651
Thanks, Jim. I have AIX 6.1
Thanks, Jim. I have AIX 6.1
4,267
Posted By MIA651
Converting string to integer
I have a function that is supposed to check for user processes and wait for 0 count before exiting the function. I am sure I have more than one issue in my code, but the stumbling block right now is...
2,300
Posted By MIA651
Thanks vgersh99! Always the simplest mistakes!
Thanks vgersh99! Always the simplest mistakes!
2,300
Posted By MIA651
Storing a variable using sed
I would like to use sed to store a variable.

The code is :

echo $HEADERREC
CUTVAR=$(echo "$HEADERREC"|sed 's/SDV/STR')
echo $CUTVAR


Output I am getting now:
...
794
Posted By MIA651
Using awk within a variable
Hi,

I am trying to get the first field of a defined variable using awk (or anything else for that matter) and I am struggling with errors.

Here is what I am using:
HEADRREC is hard coded just...
5,905
Posted By MIA651
Yoda, Thanks, I realized my mistake: ...
Yoda,

Thanks, I realized my mistake:

if [[ $# < 1 ]]
then
echo "No parameters received"
else
while getopts :d opt


Should be:

if [[ $# < 1 ]]
then
echo "No parameters...
5,905
Posted By MIA651
Yoda, I am using ksh as you are. The value...
Yoda,

I am using ksh as you are. The value for the variable DIV is passed in as an argument.
5,905
Posted By MIA651
Pattern Matching in IF-ELSE statement
Hi all,

I am trying to use an if statement to see whether a variable falls under any of the 5 patterns:

if [[ "$DIV" = @(ter|bom|hre|nte|mol) ]]
then
echo "something"
else
echo "Please...
1,479
Posted By MIA651
Redirecting output for the entire script
Hi All,

I am trying to redirect output for every line in a korn shell script that is going to generate output and append it to a log file.

I have been doing this after EACH and every line...
Showing results 1 to 25 of 46

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