Search Results

Search: Posts Made By: smenago
2,800
Posted By smenago
Solved
Akshay,
Thanks so much!! This is solved.
:b:
2,800
Posted By smenago
Yes. I tried to simply my issue by putting the...
Yes. I tried to simply my issue by putting the session ID and file name in a file and then using the contents of that file to extract the user name for the session ID. I was then struggling to use...
2,800
Posted By smenago
From the file content below which is from a...
From the file content below which is from a sftplog I need extract the user and the file name into a file. I would like to use nawk to do so, but am open to any other menthods. The only way to...
2,800
Posted By smenago
Hi all, Any assistance or suggestions on the...
Hi all,
Any assistance or suggestions on the above is much appreciated. I have read more and tried different code, but cannot obtain the desired result.

Thanks.
2,800
Posted By smenago
Hi R.Singh, I tried the following, but...
Hi R.Singh,

I tried the following, but received a lot more of the content of the source file.


/usr/xpg4/bin/awk 'FNR==NR{A[$1]=$2;next} ($2 in A){sub(/.*user /,X,$5);sub(/ from/,X,$5);print...
2,800
Posted By smenago
The input from the sftplog looks like this ...
The input from the sftplog looks like this

Feb 11 12:01:46 ftp02 sftp-server[11977]: [ID 800047 local1.info] session closed for local user tom from [65.200.105.28]
Feb 11 20:49:57 ftp02...
2,800
Posted By smenago
Multiple bash variables passed into nawk
I have a file that has 2 fields called b_file:

11977 DAR.V3.20150209.1.CSV
3295 DAR.V3.20150209.1.CSV
1721 DAR.V2.20150210.1.CSV

I need to search a sftplog using the field 1, but want to...
1,503
Posted By smenago
If I try using that I receive the following - ...
If I try using that I receive the following -


+ nawk -vst=19679 '$5 ~ st && /closed/ && /user/ && !/ORG/ && !/LE/ { for (x=1;x<=NF;x++) if ($x~"user") print $(x+1) } ' /var/adm/sftplog
nawk:...
1,503
Posted By smenago
Nawk match regex of bash variable
Using a bash for loop to pass variables into a nawk loop to capture a string in an sftp log. Tried several different syntax methods to have the variable treated as a regex so the loop will capture...
2,170
Posted By smenago
:b:Yes. Thanks for the help as the explanation...
:b:Yes. Thanks for the help as the explanation helped resolve the issue.

Appreciate the help.
2,170
Posted By smenago
Thanks for the input. I reassigned correctly and...
Thanks for the input. I reassigned correctly and tried to alter the command based on the interpretation of the gsub.

I simplified it to the below.

nawk -F / -vz=Peoccam.20140613 ' {...
2,170
Posted By smenago
Thanks. Seeing a different approach does help. ...
Thanks. Seeing a different approach does help.

However, do you have any ideas why the sub is not substituing. In the original piece of code I did the following-

nawk -F "/" -v y=$i,z=$new_f...
2,170
Posted By smenago
I need to execute an mv on the file to rename...
I need to execute an mv on the file to rename with the date appended. I removed the mv command from the post for simplicity.

So bascially I need to rename the file and then change the name in...
2,170
Posted By smenago
Nawk sub not substituting
I am trying to use nawk sub to substitute a string in a file. Both the pattern and the replacement I set as variables using bash.

here is the code:

#!/bin/bash -x...
1,875
Posted By smenago
Worked. Appreciate the help.
Worked. Appreciate the help.
1,875
Posted By smenago
Worked. Thanks a bunch. I need to add a trailer...
Worked. Thanks a bunch. I need to add a trailer to this file as well and tried to pipe in the 2nd sed command, but received the same error.

cat test3.sh
outfile='DAR.V2.2012115.1.CSV'
...
1,875
Posted By smenago
I removed the trailing space and checked to make...
I removed the trailing space and checked to make sure there were not others with a :set list, but the same message returned.


outfile='DAR.V2.2012115.1.CSV'$
$
testfile='totality_request.sql'$...
1,875
Posted By smenago
sed garbled error message in bash shell
Sed garbled error. Cannot determine why the sed command to insert a line at the beginning of a file will not work on declared variables.

outfile='DAR.V2.2012115.1.CSV'
...
3,822
Posted By smenago
Removing echo and backticks fixed it. I have no...
Removing echo and backticks fixed it. I have no idea why I was using echo - totally useless. I read the link provided. Thanks so much.
3,822
Posted By smenago
bash ls command file issue
ls -l /md01/EL/MarketData/inbound/ststr/INVENTORY* |tail -5 |awk '{ print $5,$6,$7,$8,$9 }'If I run the above from the command line the output to md_email is formatted correctly as

78213497 May...
7,703
Posted By smenago
Thanks. I believe the qoutes were the issue as...
Thanks. I believe the qoutes were the issue as after removing the outside qoutes the command executed successfully through the cron.
7,703
Posted By smenago
Ok. I tried sourcing the profile in the script...
Ok. I tried sourcing the profile in the script like so because I figured there was something different in the cron. I will try using the code you provided.

source /etc/profile
7,703
Posted By smenago
Ok. Would it make more sense to indicate a...
Ok. Would it make more sense to indicate a source in the beginning of the script like

bc=/usr/bin/bc
cut=/usr/bin/cut

or explicitly state the path in the declaration-

amt="`echo...
7,703
Posted By smenago
Hi, Here is the cron entry - 5,20,35,50 *...
Hi,
Here is the cron entry -

5,20,35,50 * * * * /md01/EL/crons/md_get_all_wrapper.sh > /dev/null 2>&1

First line in the script is

#!/bin/bash -x
7,703
Posted By smenago
bash "not found" error
In solaris, I am using a bash script which includes the following variable declaration. The script executes successfully on the command line, but when executed through the cron, I receive a "not...
Showing results 1 to 25 of 25

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