Search Results

Search: Posts Made By: ChicagoBlues
2,074
Posted By ChicagoBlues
Sorry, forgot to mention, it is in bash. ---...
Sorry, forgot to mention, it is in bash.

--- Post updated at 02:49 PM ---

This works for '/'. Thanks. What about characters like \ ] * [

sed...
2,074
Posted By ChicagoBlues
Replace Pattern with another that has Special Characters
Hello Team,

Any help would be much appreciated for the below scenario:

I have a sed command below where I am trying to replace the contents of 'old_pkey' variable with 'new_pkey' variable in a...
3,360
Posted By ChicagoBlues
Thanks guys, I will look into 'field splitting'...
Thanks guys, I will look into 'field splitting' concept and figure out the IFS command.

--- Post updated at 10:49 AM ---

Here is what works for me:

printf '%s\n' "$INPUT" |
while IFS=...
3,360
Posted By ChicagoBlues
Getting an unexpected newline in my while loop line-by-line feed
Hi,
I'm trying to get a line returned as is from the below input.csv file in Bash in Linux, and somehow I get an unexpected newline in the middle of my input.

Here's a sample line in input.csv
...
Forum: Programming 07-22-2016
1,697
Posted By ChicagoBlues
Tuple Error in Python
Hi,

I am getting the below error:
AttributeError: 'tuple' object has no attribute 'field_id'

This line is complaining on the below code snippet:
field_list = []
for f in...
1,618
Posted By ChicagoBlues
A simple grep against the whole file worked for...
A simple grep against the whole file worked for me (within the loop). Initially, I wasn't thinking of wrapping it in a loop. If you have a more efficient solution, then please share.

for...
1,618
Posted By ChicagoBlues
Yeah, that code is not going to work here. This...
Yeah, that code is not going to work here. This is bash in Sun OS, and that was ksh in AIX.
1,618
Posted By ChicagoBlues
File Reference Matching
Hi,

I need help with the below scenario in Bash scripting:

I have two files:
tmp.orig with the below contents
"TEST1"
"TEST2"
"TEST5"
"TEST6"

and tmp.new with below contents...
Forum: Solaris 02-25-2015
7,999
Posted By ChicagoBlues
Mailx sending but not receiving
Hi,

I need help with mailx. When I run the below mailx command, it works fine because the exit code is fine, and the message is sent to /usr/mail/<id>

echo "This is a test message" | mailx -s...
3,121
Posted By ChicagoBlues
Dropping Connection
Hi folks,

We are pushing messages to an IBM MQ queue on a AIX server where our client connects to from their Windows server and pick up the message. The

problem is that every now and then the...
10,397
Posted By ChicagoBlues
Keep the last uniq record only
Hi folks,

Below is the content of a file 'tmp.dat', and I want to keep the uniq record (key by first column). However, the uniq record should be the last record.
302293022|2|744124889|744124889...
10,741
Posted By ChicagoBlues
sed "s/.*/'&',/" myFile Thanks, this worked...
sed "s/.*/'&',/" myFile

Thanks, this worked well.
- CB
10,741
Posted By ChicagoBlues
prepend and append characters to the same line
Hi,

I have a file 'tmp.dat' that contains the below data:

81763
40829
30405
80452

I want to prepend a ' character to the beginning of every line, and I want to append ', at the end of...
6,168
Posted By ChicagoBlues
How to initialize array with a larger number?
Language: ksh
OS: SunOS

I have been getting the 'subscript out of range' error when the below array variable gets elements greater that 1024. I understand that 1024 is the default size for 'set...
14,058
Posted By ChicagoBlues
How to grep for '\'
I am trying to grep for the occurence of '\' character in a file. However, since '\' is also an escape character, it has become harder for me to search. Below is my attempt ....

# Tried to escape...
4,475
Posted By ChicagoBlues
Nohup causing issues
Hi folks... I really need some help soon with this issue I am having when I run my script using 'nohup'. Below is a function 'checkReturn' that my script uses to check whether other functions or...
18,041
Posted By ChicagoBlues
How to automate sftp in a script to 'get' files.
Hi,

I read a couple of forum entries about scripting sftp using the '-b' option, but in my case it still prompts for the password. Does anyone have a sample script for an sftp block to 'get' files...
5,748
Posted By ChicagoBlues
I am getting an error with your awk command: ...
I am getting an error with your awk command:

[PPLDEV_232] /usr/local/data/phase2/dev/extracts/CMS> awk -F "|" '{print "Line no: "NR " has " NF " fields"}' tmp.out > tmp.analyze
awk: syntax error...
5,748
Posted By ChicagoBlues
Count field frequency in a '|' delimited file
I have a large file with fields delimited by '|', and I want to run some analysis on it. What I want to do is count how many times each field is populated, or list the frequency of population for...
3,183
Posted By ChicagoBlues
Zero padding dates
I have a file with records containing dates like:

SMPBR|DUP-DO NOT USE|NEW YORK||16105|BA5270715|2007-6-6|MWERNER|109||||JOHN||SMITH|MD|72211118||||||74559|21 WILMINGTON RD||D|2003-11-6|SL# MD...
17,010
Posted By ChicagoBlues
Okay, but not all the dates are being converted...
Okay, but not all the dates are being converted as well.

- CB
17,010
Posted By ChicagoBlues
"200301106" is not a valid date. -...
"200301106" is not a valid date.

- CB
17,010
Posted By ChicagoBlues
Format date from MM/DD/YYYY to YYYYMMDD
I have a file with some date columns in MM/DD/YYYY format:

SMPBR|DUP-DO NOT USE|NEW YORK||16105|BA5270715|6/6/2007 |MWERNER|109||||JOHN||SMITH|MD|72211118||||||74559|21 WILMINGTON...
2,386
Posted By ChicagoBlues
That's better... Thanks for your time and...
That's better...

Thanks for your time and effort.

- CB
2,386
Posted By ChicagoBlues
Thanks Vidya, It seems like your code left a...
Thanks Vidya,

It seems like your code left a couple of datetimestamps like:

1995.01.27-00:00:00

Maybe it has to do with the '0'.

- CB
Showing results 1 to 25 of 91

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