Search Results

Search: Posts Made By: abhaydas
24,919
Posted By abhaydas
HI Geek's Please advise..if anything i am...
HI Geek's

Please advise..if anything i am missing
24,919
Posted By abhaydas
Won't it divert the output of below in each...
Won't it divert the output of below in each server ?

ssh -t "$2@$1" "grep -n '"$env"' $A | cut -f1 -d: | sort -u >>/tmp/a.txt"
24,919
Posted By abhaydas
Hi Folks, Need help on below code, where i...
Hi Folks,

Need help on below code, where i am trying to redirect the output of grep command in a file /tmp/a.txt for each server with this below code but it's only getting generated on server1...
24,919
Posted By abhaydas
Hi Rudic, tried executing your command in...
Hi Rudic,

tried executing your command in SOLARIS but end-up with below

bash-3.2$ sed -n '/cdc/=' abc.txt | sed 's-$-s/^/#/-' | sed -f- abc.txt
Cannot open pattern-file: -

My requirement is...
24,919
Posted By abhaydas
Thanks Rudic for your valuable comments Say...
Thanks Rudic for your valuable comments

Say in abc.txt as below i have below entries

cat abc.txt

bc
cdcggd
vdv
shhsd
cdc
skdk
cdc45ggd

and when i do grep -n cdc abc.txt
...
24,919
Posted By abhaydas
Below I am hard-coding the value of line number...
Below I am hard-coding the value of line number .How to pass it with variable ?

In my script (Solaris) say in abc.txt ,it's 3rd line I have to commentsed '3s/^/#/' abc.txt > temp && mv temp...
24,919
Posted By abhaydas
Thanks Ravinder and MadeInGermany , That helped
Thanks Ravinder and MadeInGermany , That helped
24,919
Posted By abhaydas
How to comment a specific line of a file in Solaris 10?
Hi Folks,

sed -i '3s/^/#/' abc.txt is commenting the line number 3 in LINUX

Not Working in Solaris 10 or higher

sed -i sed -i '3s/^/#/' abc.txt
sed: illegal option -- i


i have a...
2,368
Posted By abhaydas
HI wisecraker. Say below is my code for...
HI wisecraker.

Say below is my code for logging and fs_ck function
if script fails at fs_ck function then script should remember this and next time i execute my script it should start from...
2,368
Posted By abhaydas
Can we create any check-point feature in shell ?
I have a script as below and say its failed @ function fs_ck {} then it should exit and next time i execute it it should start from fs_ck {} only

Please advise


#!/bin/bash

logging {}...
3,024
Posted By abhaydas
Check status of process
Hi All,
Have a query
How to check for a process and if down start it , try if for 2 times and its not starting don't do it
My code is working to some extent but while starting try starting both...
2,230
Posted By abhaydas
Please advise ,where its going wrong in syntax.
Please advise ,where its going wrong in syntax.
2,230
Posted By abhaydas
Getiting below error + cd /tmp/dir ...
Getiting below error


+ cd /tmp/dir
./a.sh: line 6: syntax error in conditional expression
./a.sh: line 6: syntax error near `='
./a.sh: line 6: ` if [[ -f "$i" = "345.zip"]]'
2,230
Posted By abhaydas
Compare file name and take action
Have some files in /tmp/dir

abc.zip
123.zip
345.zip

and if name matches to 345.zip then take action
My code....

am i doing something wrong ? Please advise.


#!/bin/bash
set -x
cd...
754
Posted By abhaydas
Test a condition for n times and take action
i have to test a condition for n times and if its value is greater than one each time for continuous 5 iterations it will take action

My Approach

run the same command 5 times in for loop and...
844
Posted By abhaydas
Actually i was busy ...so was not able to work on...
Actually i was busy ...so was not able to work on it...
However i thank you all for keep helping beginners like me....:)
866
Posted By abhaydas
Have below input file and need the output as in output file
Hi Geeks,

Have below input file and need the output

Input File

Uber: ABC=Pqrstuv ABC2 abc pqr , G=Pqrstuv Inc, CC=US
Uber: ABC=Indiana (Automobile Business 2119), G=Indiana Group, CC=UK...
844
Posted By abhaydas
How to find the difference between epoc dates in HH:MM:SS?
How to find the difference between below epoc dates in HH:MM:SS

1557863573 converts to Tuesday May 14, 2019 21:52:53 (pm) in time zone Europe/Amsterdam (CEST)
1557866394 converts to Tuesday May...
3,233
Posted By abhaydas
Thanks , this worked like a charm :b:
Thanks , this worked like a charm :b:
3,233
Posted By abhaydas
Thanks Rudic for your help,now i am getting the...
Thanks Rudic for your help,now i am getting the desired output but what i am trying to achieve is below
i have to pass col1 and col2 values to keytool command to have it like below

keytool...
3,233
Posted By abhaydas
Tried both...none of them are working to produce...
Tried both...none of them are working to produce Desired Output as below

"abc def ijk ca" abcdefijkca
"def fff ere we" defffferewe
3,233
Posted By abhaydas
Couldn't get it IFS=$'\t' Please be kind...
Couldn't get it IFS=$'\t'
Please be kind to suggest where we need to put it.

--- Post updated at 09:39 AM ---

Please advise
Where to use this IFS=$'\t'

paste <(xargs -d'\n' -n1...
3,233
Posted By abhaydas
Need help , i have 2 files file 1 abc def...
Need help , i have 2 files

file 1
abc def ijk ca
def fff ere we
file 2
abcdefijkca
defffferewe
wrote below

#!/bin/bash
paste file11 file22 | (
while read col1 col2 ; do
echo...
3,233
Posted By abhaydas
Read 2 file line by line @ same time
HI All,

I am aware of reading one file line by line but now my requirement is to read 2 file line by line as below explained.
I have 2 files as below file 1 with spaces and file 2 same as file1...
3,229
Posted By abhaydas
Split a txt file on the basis of line number
I have to split a file containing 100 lines to 5 files say from lines ,1-20 ,21-30 ,31-40 ,51-60 ,61-100


Here is i can do it for 2 file but how to handle it for more than 2 files

awk 'NR <...
Showing results 1 to 25 of 33

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