Search Results

Search: Posts Made By: Mannu2525
4,956
Posted By Mannu2525
Extract strings from the file using awk s
Hi,

I'm trying to make a file that gives me useful information. Format of file is below:-


--- (Tue Apr 14 09:46:43 EDT 2020): JOIN_Constraints_Schema:test_simple_joins -------------...
2,294
Posted By Mannu2525
How to preserve the same text and modify the same text to append?
Hi,

I have an issue modifying a file. Below is the content of the file.

File name - a.txt
SELECT LISTAGG(SCORE), LISTAGG(VB),
LISTAGG(SCORE*12 + 3),
LISTAGG(DOB)
from...
2,637
Posted By Mannu2525
Use this:- [test ~]$ mount |grep /data | awk...
Use this:-

[test ~]$ mount |grep /data | awk -F '=|)' '{if(!match($0, /nodev/)){print $(NR)"="$(NR+1)",nodev)"} else {print $0}}'
/dev/sdb on /data type ext4 (rw,relatime,data=ordered,nodev)
955
Posted By Mannu2525
Insert a value between two empty delimiter in the file.
Would like to insert value between two empty delimiter and at the very last too if empty.


$ cat customerleft.tbl
300|Customer#000000300|I0fJfo60DRqQ|7|17-165-193-5964|8084.92|\N|p fluffily...
860
Posted By Mannu2525
Thanks, but it showing bad if we have p1=212856...
Thanks, but it showing bad if we have p1=212856 and g1=1482568
860
Posted By Mannu2525
Extracting and comparing values
I was trying to extract value of g1 and p1 only inside the tags where t1 is "Reading C (bytes)" and comparing them to make sure p1 is always less than g1. Here is the Json file I'm using -

File:-...
1,883
Posted By Mannu2525
How to integrate all the systemctl commands into a shell script to verify any daemon/agent service?
Hi,

Can we integrate all the systemctl command into a shell script to verify any service with all the options of systemctl if service integrate with the operating system service management tools...
993
Posted By Mannu2525
Hi, If you are trying to increase the counter on...
Hi, If you are trying to increase the counter on every line with the occurrence of SYSTEM_ADMIN then below script will help you out -

mannu]$ cat testmannufor1.sh
#! /bin/bash

rm -rf...
847
Posted By Mannu2525
Try this:- awk -F"=" 'BEGIN {NR==1}...
Try this:-

awk -F"=" 'BEGIN {NR==1} /\$Temp/{print $2}' /DIRECTORY/*

Here it what I've tried:-


n]$ cat a1.out
$Temp=mannu

n]$ cat a2.out
$Temp=jskobs


$ awk -F"=" 'BEGIN {NR==1}...
972
Posted By Mannu2525
Like if something gonna change in config_file...
Like if something gonna change in config_file like commenting any test or anything has to be written in the line apart from cd and test. Yes, for now, it's working but I'm looking for the...
972
Posted By Mannu2525
Hi RudiC, I have written a code to serve the...
Hi RudiC,

I have written a code to serve the purpose but looking for a more robust way to deal with it.


$ cat testscript.sh

#!/bin/bash

filename="config_file"


#!/bin/bash
...
972
Posted By Mannu2525
Switching between directories and mkdir/copy dir/file
I was trying to copy the files inside the path /home/user/check/Q1/dir/folder1/expected/n/a1.out1 and a1.out2 and a1.out3 to /home/user/check/Q2/dir/folder1/expected/n/

if n directory is not...
1,768
Posted By Mannu2525
If I'm using below pattern, it will error out. ...
If I'm using below pattern, it will error out.

sed '
/^ *(/N
/^\( *(* *\n* *(* *\)\([sS][eE][lL][eE][cC][tT]\)/{
s//\\\o | grep \x27Send\\|Recv\\|Execute on\x27 | sed -e \x27s/^[ \\t]*//g\x27...
1,768
Posted By Mannu2525
Thanks MadeInGermany!! Your code is working for...
Thanks MadeInGermany!! Your code is working for me in mentioned scenarios.

Could you please help out if we have some data like -


(
select blah blah
hello
select blah blah
;

select...
1,768
Posted By Mannu2525
sed for appending a line before a pattern and after another patter.
Hi All,

I'm appending a line before a pattern and after another pattern(;) but omitting the first pattern - same as if comes duplicates before the second pattern.

Also, I'm adding a word before...
1,510
Posted By Mannu2525
Here you go - # cat examplefile.txt ...
Here you go -

# cat examplefile.txt
ghi|NN603762|eee
mno|NN607265|ttt
pqr|NN613879|yyy
stu|NN615002|uuu
jkl|NN607265|rrr
vwx|NN615002|iii
yzA|NN618555|ooo
def|NN190486|www...
2,073
Posted By Mannu2525
Variable in not resolving in sed
I'm trying to search the 2 pattern in consecutive lines and print them but my variables are not resolving in sed (using bash shell) -

# cat testfile2.txt
Fixing Storage Locations to remove extra...
1,110
Posted By Mannu2525
Need to optimize the loop to load parallelly
Hi,

I'm trying to load the huge amount of records in the database. I did the successful load but it took more time to load as numbers are huge.

Here what I have -

1. create a database...
6,088
Posted By Mannu2525
Able to do it using sed...
Able to do it using sed '/WARNING/N;/^\(.*\)\n\1$/!P; D' File.txt
6,088
Posted By Mannu2525
Remove duplicate consecutive lines with specific string
Hello,

I'm trying to remove the duplicate consecutive lines with specific string "WARNING".

File.txt
abc;
WARNING 2345
WARNING 2345
WARNING 2345
WARNING 2345
WARNING 2345
bcd;
abc;...
984
Posted By Mannu2525
The structure of the file is same and each...
The structure of the file is same and each section is separated by space - Yes much longer than the example here but separated by space.
984
Posted By Mannu2525
Script to change the file content using some conditions
Hello,

I would like to change the content of the file that has few blocks starts with 10 and ends with ";"

File1.txt

10 bonuses D
20 MATCHED
30 UPD COL
40 (SOL=30)
20 NOT...
778
Posted By Mannu2525
Running a remote script with automatic options
I'm trying to run a script that will remotely copy another script to remote host and run copied script to remote server with automatic options-

#! /bin/bash

HOSTNAME="1 2"
for HOST in...
Forum: Debian 11-12-2016
3,704
Posted By Mannu2525
Suggestions needed to upgrade Debian 7.8 to Debian 8.5 (Not 8.6)
Hello,

I need to upgrade my Debian system 7.8 to 8.5 but by default via apt-get It moves to 8.6 version(latest stable version). I'm new to Debian so didn't figure out the solution.

I've checked...
1,029
Posted By Mannu2525
\n count as a single character. there are no more...
\n count as a single character. there are no more special cases and yes strings all surrounded by single-quotes.

I've used the below code but not approaching to the result - bit of success

sed...
Showing results 1 to 25 of 49

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