Search Results

Search: Posts Made By: netdbaind
6,937
Posted By vgersh99
Borrowing from Don: awk -F, -v date=$(date...
Borrowing from Don:

awk -F, -v date=$(date '+%Y%m%d%H%M%S') 'FNR>1{$6=date}1' OFS=, final_copy.csv
6,937
Posted By RudiC
Try awk -F "," 'BEGIN{ OFS=","; cmd = "date...
Try awk -F "," 'BEGIN{ OFS=","; cmd = "date '+%Y%m%d%H%M%S'"} NR>1 {cmd | getline $6; close (cmd)} 1' file
6,937
Posted By Don Cragun
The awk system() function returns the exit code...
The awk system() function returns the exit code of the command that it executes; not the output produced by that command. Unless your input is coming from a slow running pipeline (which is not the...
3,227
Posted By rdrtx1
ls=$(cal | awk '$1+=0 {ls=$1} END {print ls}') ...
ls=$(cal | awk '$1+=0 {ls=$1} END {print ls}')
ts=$(date +"%d")

[[ $ls = $ts ]] && echo "today is the last sunday of the month"
9,026
Posted By RavinderSingh13
Hello netdbaind, Following may help you in...
Hello netdbaind,

Following may help you in same.
Let's say following is cal.


cal
October 2014
Su Mo Tu We Th Fr Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18...
9,026
Posted By RudiC
How about cal | awk 'NR==3 {print 15+NF%7}' 19 ...
How about cal | awk 'NR==3 {print 15+NF%7}'
19
And, if you run it on every Sunday, you can check if date +"%d" is between 15 and 21.
9,026
Posted By RavinderSingh13
Hello netdbaind, I agree with vbe's...
Hello netdbaind,

I agree with vbe's solution like we can run script on each Sunday and check either it is 3rd Sunday or not.
Following code may help you to get the 3rd Sunday with explaination....
5,863
Posted By RudiC
$ sed -n '1p; /Network/p' file Filesystem ...
$ sed -n '1p; /Network/p' file
Filesystem Size Used Avail Use% Mounted on
4.0T 523G 3.5T 13% /Network/Test
$ awk 'NR==1 || /Network/' file
Filesystem ...
1,643
Posted By balajesuri
to=$(date -d "2013-02-12 11:46:40.197045" +%s) ...
to=$(date -d "2013-02-12 11:46:40.197045" +%s)
from=$(date -d "2013-02-11 00:46:40.389037" +%s)
echo $(( $to - $from ))
7,736
Posted By Jotne
You can use Integer F=$(($E/$S)) Non...
You can use
Integer
F=$(($E/$S))

Non integer
F=$(echo $E $S | awk '{print $1/$2}')
58.9564
7,736
Posted By cero
When dealing with non-integer numbers I'd...
When dealing with non-integer numbers I'd recommend to use bc instead of expr.
$ E=1296863.27001857757568359375
$ S=21997
$ F=$(echo "$E / $S" |bc)
$ echo $F
58
$ F=$(echo "scale=20; $E / $S"...
1,509
Posted By ./hari.sh
sort <filename> | tail -1
sort <filename> | tail -1
1,509
Posted By Yoda
sort -n filename | tail -1
sort -n filename | tail -1
1,812
Posted By jim mcnamara
One way of many to do this: Part A. ...
One way of many to do this:

Part A.
create a list of script files with full script files names: e.g., /path/to/script.sh
Next use that list to create a file with checksums

while read fname ...
Showing results 1 to 14 of 14

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