Search Results

Search: Posts Made By: invinzin21
1,509
Posted By MadeInGermany
It is a bit confusing. For example, what is...
It is a bit confusing. For example, what is FILESINEED? What is VIEWBINARY?
Perhaps the following puts you on the right track?
for i in `find ./ -mtime -1 | grep FILESINEED`
do
case `VIEWBINARY...
1,634
Posted By nezabudka
Maybe I misunderstood something. Here are my drop...
Maybe I misunderstood something. Here are my drop
sed '/-1111|/ s/|165|/|server1|/' file

--- Post updated at 23:34 ---

You can be safe as it is. I think that will be enough
sed '/-1111|/...
1,634
Posted By RudiC
You may pimp up your own approach by adding an...
You may pimp up your own approach by adding an address specification. Be aware that it will NOT change the third field if that doesn't contain 165, or change any other field that holds that value.
...
1,634
Posted By vgersh99
how about to start with - you may have to make...
how about to start with - you may have to make slight adjustments based your more detailed requirements:

awk -F'|' '$5~(pat "$"){$3=ser}1' pat=1111 ser=server1 OFS='|' myFile
1,802
Posted By Scrutinizer
If you have grep -o, for the email...
If you have grep -o,

for the email addresses (even though a lot more characters are allowed, but this is what the perl says):
grep -Eo '[[:alnum:]_.-]+@[[:alnum:]_.-]+[[:alnum:]]+'

Filenames...
1,400
Posted By vgersh99
how about - could probably be improved: sed...
how about - could probably be improved:

sed 's/\(.*\)\(\..*\+.*\) *\(.*\)$/\1 \3/g' myFile
1,400
Posted By drl
Hi. To get the best advice on transforming,...
Hi.
To get the best advice on transforming, extracting, manipulating data,
please supply the environment and context:

1. Os and shell, preferably with versions
2. Representative input
3....
1,400
Posted By drl
Hi. Using perl, and taking advantage of the...
Hi.

Using perl, and taking advantage of the unique context of each date-related chunk:
#!/usr/bin/env bash

# @(#) s1 Demonstrate string manipulation, based on context.

# Utility...
2,093
Posted By jim mcnamara
This question is really rather vague. But since...
This question is really rather vague. But since I do not want to seesaw back and forth trying to extract details, consider:

1.cronjob opens for write a log e.g., /path/to/files/logfile
2. write...
2,093
Posted By hicksd8
Another suggestion is to insert a line just...
Another suggestion is to insert a line just before your cron job finishes to write out a timestamp file. Then you set up a simple second cron job to run, say, five minutes after the first job to...
3,400
Posted By rbatte1
You can try the command yes, however another way...
You can try the command yes, however another way would be to change your ssh command to automatically accept the fingerprint. This has the drawback that you trust everything you connect to and you...
1,837
Posted By RudiC
Try awk -vLNO=4 'NR<=LNO {TMP[NR]=$0;next} 1;...
Try awk -vLNO=4 'NR<=LNO {TMP[NR]=$0;next} 1; NR==LNO*2 {for (i=1; i<=LNO; i++) print TMP[i]}' file
5
6
7
8
1
2
3
4
9
10
1,837
Posted By RavinderSingh13
Hello invinzin21, Following may help you in...
Hello invinzin21,

Following may help you in same.

awk '{if(NR==1 || NR==2 || NR==3 || NR==4){A=A?A ORS $0:$0;next};if(NR==8){print $0 ORS A;} else {print}}' Input_file
Output will be as...
3,177
Posted By Aia
Where do you extract the www.google.cz; ? ...
Where do you extract the www.google.cz; ?

google.cz
czechrepublic.google.cz
brno.google.cz


Anyway, perhaps something like this would be close to a solution.
awk 'NF>1 {
...
3,177
Posted By RudiC
Starting from your "fail code", how would you...
Starting from your "fail code", how would you like these adaptions:while read SN RWT
do echo "server {"
echo " listen 80;"
echo " server_name $SN"
...
3,177
Posted By Scrutinizer
In addition to RudiC's suggestion, you can use...
In addition to RudiC's suggestion, you can use ${SN#*://} instead of $SN to strip of the URL protocol part if present..
4,026
Posted By Yoda
Check $2 value and perform required arithmetic: ...
Check $2 value and perform required arithmetic:
awk '{s+=($2=="MB"?$1*1024:$1)}END{print s " MB"}' file
4,026
Posted By vbe
Well so far and your subject are clear on what...
Well so far and your subject are clear on what you did: Considering only column 1...
So your "what if"... would be to look also at column 2, and depending what you find, add a conversion to the...
1,361
Posted By Scott
I refer you to this recent thread: recent thread...
I refer you to this recent thread: recent thread goes here (https://www.unix.com/unix-dummies-questions-answers/227053-sorting-files-ending-numbers-sort.html)!


$ sort -nk1.8 < file
student1...
1,361
Posted By Scott
Have a look at the paste...
Have a look at the paste (https://www.unix.com/man-page/linux/1/paste/) command.

i.e.

paste - - < file


By default the delimiter is a tab, but you can change that.
Showing results 1 to 20 of 20

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