Visit The New, Modern Unix Linux Community

Search Results

Search: Posts Made By: greet_sed
547
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:
912
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...
635
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...
690
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...
543
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'
8,448
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
670
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
...
8,448
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...
1,258
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 !
1,258
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"...
6,926
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
3,581
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...
3,581
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...
1,652
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,129
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 :
...
1,388
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...
3,142
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"
769
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
1,336
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 ?
821
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
900
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...
1,276
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
2,083
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]...
2,083
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...
2,071
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

 

Featured Tech Videos

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