Search Results

Search: Posts Made By: rosebud123
15,993
Posted By rosebud123
Here is the version and the shells ...
Here is the version and the shells

admin@2a[/home/user/badmin]# cat /etc/shells
/bin/csh
/bin/ksh
/bin/psh
/bin/tsh
/bin/bsh
/usr/bin/csh
/usr/bin/ksh
/usr/bin/psh
/usr/bin/tsh...
15,993
Posted By rosebud123
nc command did not work as well. ...
nc command did not work as well.

admin@pa[/home/user/admin]# nc -s x.x.x.x x.x.x.x 443
ksh: nc: not found.

Please advise
15,993
Posted By rosebud123
Telnet command on AIX
Hello,

I need to verify whether I am able to make connection to a remote server from my AIX (os level : 7.1.0.0) host.

The host has 2 Alias IP's how can I force an source Alias IP on the telnet...
2,425
Posted By rosebud123
Prune Option for Find Command on AIX
I need to delete all files from the working directory and its sub directories using the find command, for that I am using -prune option but some how I am having a syntax issue.

I have tried the...
16,400
Posted By rosebud123
Is this correct { cat "${1:-file}"; printf...
Is this correct

{ cat "${1:-file}"; printf '\n'; } | awk '
{ if(empty)
print "\n"
if($0 != "\n") {
print
empty = 0
} else empty = 1
}' > "${2:-newfile}"
16,400
Posted By rosebud123
Hi Don, One small change , what if I only...
Hi Don,

One small change , what if I only need to add the LF if it does not exist at the end of the file , do I just remove the \r from the code ?

Please advise
16,400
Posted By rosebud123
Hi, I tried this , I am using cat command...
Hi,

I tried this , I am using cat command which is not efficient


cat source.txt | sed 's/[^[:print:]\r\t]//g' | perl -lpe 's/\x0d$//' > output.txt
16,400
Posted By rosebud123
awk Command to add Carriage Return and Line Feed
Hello,

Can someone please share a Simple AWK command to append Carriage Return & Line Feed to the end of the file, If the Carriage Return & Line Feed does not exist !

Thanks
12,575
Posted By rosebud123
Thank you Rudi C & Peasant
Thank you Rudi C & Peasant
12,575
Posted By rosebud123
Peasant, Did you try running Rudic's code ? ...
Peasant,

Did you try running Rudic's code ?

Thanks
12,575
Posted By rosebud123
Rudi C. The three output file names have 1_...
Rudi C.

The three output file names have 1_ as prefix , can you please update the code to go in sequential manner i.e. 1_xx, 2_xxx e.t.c

Thanks
12,575
Posted By rosebud123
Hi Peasant I tried few options but I am no...
Hi Peasant

I tried few options but I am no way closer. I captured column seven in variable, I need to now check this variable against the next line and then split when it changes.

awk -F\| '{...
12,575
Posted By rosebud123
awk command to split pipe delimited file
Hello,

I need to split a pipe de-limited file based on the COLUMN 7 value . If the column value changes I need to split the file

Source File
...
821
Posted By rosebud123
Count Pattern using awk
I need to get a count of all the records that start with 4 and then print the value.

I have the below statement but it is missing something, can someone help me to fix this


awk...
7,467
Posted By rosebud123
Thanks
Thanks
7,467
Posted By rosebud123
Thanks. I adjusted the script as below ...
Thanks.

I adjusted the script as below


#!/usr/bin/ksh
PAR1=$1
PAR2=$2
PAR3=$3

awk '{y=substr($2,1,4); f=b} y<lt{f=a} y>gt{f=c} {print>f} ' lt="${PAR1}" gt="${PAR2}" a=y1 b=y2 c=y3 $PAR3...
7,467
Posted By rosebud123
Correct...How to run the AWK inside a shell...
Correct...How to run the AWK inside a shell script by passing parameters
7,467
Posted By rosebud123
Thanks. Is there a way to not hard code 2017...
Thanks.

Is there a way to not hard code 2017 and 2018 , rather pass them as a parameters ?
7,467
Posted By rosebud123
Thanks.. Can you please explain the code in...
Thanks..

Can you please explain the code in few lines
7,467
Posted By rosebud123
Split file using awk
I need to split the incoming source file in to multiple files using awk.

Split position is (6,13) : 8 positions


All the records that are greater than 20170101 and less than or equal to...
4,531
Posted By rosebud123
The input file had control M characters, thats...
The input file had control M characters, thats the reason the script did not work properly. After fixing the control M characters it gave me the output.

Issue # 1

I have another peculiar...
4,531
Posted By rosebud123
The output is a zero byte file, something is...
The output is a zero byte file, something is wrong

-rw-rw-r-- 1 admin test 0 Jul 21 14:10 output.test127.txt
4,531
Posted By rosebud123
It's a copy paste error , I do not have ~ in the...
It's a copy paste error , I do not have ~ in the script.

I opened the script in vi editor and when I copy pasted it added a ~

#!/usr/bin/bash
while read T
do ((CNT++))
for...
4,531
Posted By rosebud123
The script sits there and never completes , is...
The script sits there and never completes , is the script expecting proper record terminators on the file ?

#!/usr/bin/bash
while read T
do ((CNT++))
for ((i=0; i<${#T}; i++))
...
4,531
Posted By rosebud123
The script is running but where is it writing the...
The script is running but where is it writing the output to ?

Test.TXT is my input file , can I re-direct the output to a file rather than printing it on the screen ?
Showing results 1 to 25 of 37

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