Search Results

Search: Posts Made By: greet_sed
1,010
Posted By greet_sed
Hi, awk -F"[|:-]" ' { print $1 "\t" $2 "\t"...
Hi,

awk -F"[|:-]" ' { print $1 "\t" $2 "\t" $3 "\t" $1 ":" $2 "-" $3 "\t" "." "\t" $4}' file

Gives the desired output:
1,707
Posted By greet_sed
Hi, In sed: echo...
Hi,

In sed:
echo "xy--#growncars#vello--hello3--hello4--jello#growncars#dello--gello--gelloA--gelloB#growncars#" | sed -e 's/.*#growncars#\(.*\)#growncars#\(.*\)#growncars#/\1\n\2/'

Gives...
1,308
Posted By greet_sed
Hi, EXPLIB_SUBDIRS+= abc sprc cpd ...
Hi,

EXPLIB_SUBDIRS+= abc sprc cpd

appending the list of directories to a variable EXPLIB_SUBDIRS in above line.

IMO, what (external) libraries , include files , header files are to be...
1,492
Posted By greet_sed
Hi, can you try something like this ? ...
Hi,

can you try something like this ?

tar tf all.tar.gz | grep ".xml" > all-xml-file-list

#if you dont have file list from batch ,create it
rm -f batch-file-list
for i in bat*.tar.gz
do...
1,159
Posted By greet_sed
Hi, you are missing \ for basic grep to use...
Hi,

you are missing \ for basic grep to use or.

$script | grep 'Write to ECC( SSID=MARGIN)\|is not greater than existing logical processing'
13,011
Posted By greet_sed
Hi, xmllint file.xml --xpath...
Hi,

xmllint file.xml --xpath '//PORTED_NUM/text()'

More simple :b:

However when i run, i get


xmllint --version
xmllint: using libxml version 20706
1,140
Posted By greet_sed
Hi, Seems perl syntax for if , variables are...
Hi,

Seems perl syntax for if , variables are used.

IMHO, you need to update your code as follows:
#!/bin/sh
Type=p
Con=c
Pl=t

if (( $1 == 'a' )); then
if (( $Type == 'p' )); then
...
13,011
Posted By greet_sed
Hi, IMO, if it is xml file with proper xml...
Hi,

IMO, if it is xml file with proper xml syntax then xmllint is better choice.

Read man xmllint for detailed information.


echo "cat...
3,975
Posted By greet_sed
you can modify the code i posted before and...
you can modify the code i posted before and change cp to mv

Please read man mv and see how it differs from cp syntax wise !
3,975
Posted By greet_sed
Hi, Welcome to the Forum! Here is one...
Hi,

Welcome to the Forum!

Here is one way.
Can you try the below and see if it helps:
#!/bin/bash

SOURCE="/data/Customer-Files-1"
DEST="/data/Customer-Files-Over-2-Years-Old"...
19,437
Posted By greet_sed
Hi, Check man sshpass nohup sshpass -p...
Hi,

Check man sshpass

nohup sshpass -p 'password' scp file user/pass@host:/dir
6,907
Posted By greet_sed
Hi, It depends on what you have in $5 and...
Hi,


It depends on what you have in $5 and if condition succeeds.
value is sumed up only when if condition is executed.

I tried as follows and looks fine :

cat f1...
6,907
Posted By greet_sed
Hi, Can you try like this? DATE=$(date...
Hi,

Can you try like this?

DATE=$(date +%Y%m%d -d "1 day ago")
awk -F, -vy=DATE '$0 ~ y {a[FILENAME]++ } END { for (i in a) { print i a[i] }}' /path1/usr/STAT/GPRS/ESTCOL_GPRS_2016*

If...
5,723
Posted By greet_sed
Hi, you can try the following: sed -e 's/...
Hi,

you can try the following:
sed -e 's/ Ford[a-zA-z]+//g' file

g is added for global replacement for given input in post #1 g is not required.

or

awk '{for (i=1;i<=NF;i++) { if ($i ~...
1,990
Posted By greet_sed
Hi, You do cd twice so your directory is not...
Hi,

You do cd twice so your directory is not same as when your first line of
for IP in `egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' config_ip.cfg`Hence this grep says no such file or directory :
...
2,303
Posted By greet_sed
Hi, RudiC & Ravinder solutions are :b: ...
Hi,

RudiC & Ravinder solutions are :b:

Here is another try :)

while IFS=. read a b;
do
if [ "$x" != "$a" ]; then
x=$a
printf "\n'%s','%s'" "$x" "$b"
else
printf ",'%s'" "$b"
fi...
14,541
Posted By greet_sed
Hi, You mean like this ? cat test.sh ...
Hi,

You mean like this ?

cat test.sh
echo $1

./test.sh x
x

or
./test.sh <<< echo "x"
1,443
Posted By greet_sed
Hi, No, you can't. Because element is...
Hi,



No, you can't. Because element is removed from array.

See the example:
X=(2H 4S 10D QC)
$ echo ${X[2]}
10D
$ unset X[2]
$ echo ${X }
2H 4S QC

Here X[2] is QC
3,645
Posted By greet_sed
Hi, Welcome to Unix forum! cut -d"|"...
Hi,

Welcome to Unix forum!

cut -d"|" -f1 file
gives following output for given input as per post #1.

What is your expected output ?
1,449
Posted By greet_sed
Hi, can you try the below one? awk...
Hi,

can you try the below one?


awk -F"|" -vv1="2016/13/19 11:12:11 PM" -vv2="20-11-16" 'NR==FNR{b[$1];next} {if ($1 in b)
{ $3=v1;$5=v2;print}
}' OFS="|" input Modify
2,095
Posted By greet_sed
Hi, When i try the command RudiC ( including...
Hi,

When i try the command RudiC ( including your addition of 264 in latest post ) it works as expected.

cat file
501254424;500440257;PE PACKS;300467279;PREP;;276476070;655031001867176;Two...
2,882
Posted By greet_sed
Hi you have not specified which shell you are...
Hi
you have not specified which shell you are using.

Similar to echo -n there is a support in ksh ONLY with print command

-n
print does not append a newline to its output
3,928
Posted By greet_sed
@ RudiC: Can you please explain the last...
@ RudiC:

Can you please explain the last part ?

awk '
NR==1 {HD = $0 # Get first line ie header
next # Dont run any other commands. ie read next line.
}

!FN[$5]...
3,928
Posted By greet_sed
Hi, Can you try this one ? awk -F,...
Hi,

Can you try this one ?

awk -F, 'NR==1{a=$0;next} $5 ~ /TATA7980/ { if (NR==2) print a > $5".csv";else print > $5".csv"} $5 ~ /TATA3405/ { print > $5"_f1.csv"} ' OFS=","file

Modify for...
4,908
Posted By greet_sed
Hi, IMO, command you have tried looks good...
Hi,

IMO, command you have tried looks good :b:
Showing results 1 to 25 of 256

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