Search Results

Search: Posts Made By: sharsour
2,879
Posted By krishmaths
Or you can modify your awk statement to as below ...
Or you can modify your awk statement to as below

awk '{for(i=2;i<=NF;i++) {if (substr($i,1,1)=="#") next; else print $1,$i}}'
2,141
Posted By ahamed101
Try this... this will print both... x[1] and...
Try this... this will print both... x[1] and x[2]...

ps -ef | awk '/engine/{match($(NF-1),"domain.(.+).appl.*/(.+)\\..+",x); print x[1],x[2]}'


--ahamed
2,141
Posted By Jotne
Some like this? ps -ef | awk -F/ '/[e]ngine/...
Some like this?
ps -ef | awk -F/ '/[e]ngine/ {for (i=1;i<=NF;i++){if ($i~/domain/) {print $(i+1)}}}'
ELINKDEV
ELINKDEV
ELINKDEV
ELINKDEV
ELINKDEV
ELINKDEV
ELINKDEV
ELINKDEV
2,141
Posted By ahamed101
ps -ef | awk '/engine/{gsub(/.*\/|\..+/,x,$6);...
ps -ef | awk '/engine/{gsub(/.*\/|\..+/,x,$6); print $6}'


--ahamed
2,141
Posted By ahamed101
ps -ef | awk '/engine/{sub(/.*\//,x,$6); print...
ps -ef | awk '/engine/{sub(/.*\//,x,$6); print $6}'


--ahamed
1,457
Posted By RavinderSingh13
Hello, Could you please try the following...
Hello,

Could you please try the following code please.
Let us say test_file have the data as per your request.



$ cat test_file.ksh
value1=`awk -F: '{print$2}' test_file`
value2=`awk...
1,457
Posted By anbu23
$ tr ':' '\n' < file Post1 uri Post2 ...
$ tr ':' '\n' < file
Post1
uri
Post2
urieop
Post3
urtei
1,457
Posted By DeCoTwc
I believe below will get you what you're looking...
I believe below will get you what you're looking for.

d@AirBox:~$ v1=($(awk -F\: '{print $1}' file))
d@AirBox:~$ v2=($(awk -F\: '{print $2}' file))
d@AirBox:~$ for ((i=0 ; i < ${#v1[@]} ;...
11,054
Posted By krishmaths
You have the wildcard at the wrong place. You had...
You have the wildcard at the wrong place. You had mentioned that the files end with "Server1.txt"

So, try this

ls /home/username/Test/*Server1.txt

which is what I had suggested earlier in...
3,633
Posted By MadeInGermany
Take another delimiter that does not occur in...
Take another delimiter that does not occur in $url
sed "s#URL.#& $url#"
3,633
Posted By rajamadhavan
I think you need to make your input file like...
I think you need to make your input file like this to work


tcp:\\/\\/localhost.com:7223|7223
tcp:\\/\\/localhost.com:7224|7224
3,306
Posted By hicksd8
You don't say which Unix/Linux flavor this is...
You don't say which Unix/Linux flavor this is but, talking generic Unix, since you are wanting to use ordinary ftp (along with the security issues that might give you) you can use a .netrc file to...
3,306
Posted By snjksh
Please find the following ftp script to download...
Please find the following ftp script to download file from server.

=================================
HOST='Test03'
USER='user'
PASSWD='*****'
FILE='d.txt'
ftp -n $HOST <<END_SCRIPT
quote...
5,599
Posted By MadeInGermany
There should be $1 FS $2 FS $3 instead of $1$2$3....
There should be $1 FS $2 FS $3 instead of $1$2$3. This is still a bit ugly because the "# fields for comparison" is hard-coded (here: 3).
The following is unlimited:
awk '/^[^0-9]/ {next} {$1=$1}...
5,158
Posted By MadeInGermany
HSFILE=/home/User/Temp/Input.txt num=1 while...
HSFILE=/home/User/Temp/Input.txt
num=1
while IFS=":" read url port
do
echo "URL is $url Port is $port"
< Monitor_Template.hrb sed -e "s/URL/$url/g" -e "s/port/$port/g" > "NEWFile_$num.hrb"
...
2,063
Posted By Subbeh
It seems like the $Url variable is empty. ...
It seems like the $Url variable is empty.

This won't work:
Url= awk -F":" '{print $1}' $HSFILETry this instead:
Url=$(awk -F":" '{print $1}' $HSFILE)
21,380
Posted By Just Ice
why not just generate 1 key each for each server...
why not just generate 1 key each for each server in a production-dr server pair inside the ssh keys file? that way replication from production to dr will not clobber the dr servers' ssh key files in...
27,703
Posted By MadeInGermany
You can solve that on shell level (cd ...
You can solve that on shell level
(cd /home/Temp/Test/Log &&
awk 'FNR==1 {x=FILENAME; gsub(".","#",x); print x ORS FILENAME ORS x} 1' *.txt)
Or with more awk code
awk 'FNR==1 {fn=FILENAME;...
27,703
Posted By MadeInGermany
With a Posix awk or nawk: awk 'FNR==1...
With a Posix awk or nawk:
awk 'FNR==1 {x=FILENAME; gsub(".","#",x); print x ORS FILENAME ORS x} 1' /home/Temp/Test/Log/*.txt
27,703
Posted By MadeInGermany
It seems more logical to write a new file, not...
It seems more logical to write a new file, not append to a file
cat /home/Temp/Test/Log/*.txt > all.txt
all.txt is the concatenation of all /home/Temp/Test/Log/*.txt files in alphabetical order....
3,118
Posted By Klashxx
Or: if [ "$ServerName" = "usei01" -o...
Or:
if [ "$ServerName" = "usei01" -o "$ServerName" = "usei02" -o "$ServerName" = "usei03" ]
3,118
Posted By millan
You have to write the first if clause as below. ...
You have to write the first if clause as below.


if ([ "$ServerName" = "usei01" ]|| ["$ServerName" = "usei02" ]|| ["$ServerName" = "usei03" ]);then

;then should be in one line
3,118
Posted By rangarasan
Just try the above code :) Cheers!!! -R
Just try the above code :)

Cheers!!!
-R
1,465
Posted By Corona688
ssh username@host script.sh "whatever" The...
ssh username@host script.sh "whatever"

The 'whatever' will become the first parameter, $1.
2,178
Posted By Just Ice
the ssh command as written writes the log file...
the ssh command as written writes the log file locally so access to the log file is quicker ... you can always leave the log file on the remote server by moving the >> OutputResult.txt within the...
Showing results 1 to 25 of 37

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