Search Results

Search: Posts Made By: Ravichander
2,170
Posted By SriniShoo
awk '{sub("-",X,$0); sum += $0} END {print sum}'...
awk '{sub("-",X,$0); sum += $0} END {print sum}' file
4,157
Posted By Don Cragun
You didn't answer my question about the length of...
You didn't answer my question about the length of the longest line in your file! If you have any lines longer than 2048 bytes (including the terminating newline character), nawk may fail.


The...
4,157
Posted By Don Cragun
Making the assumption that that error code is...
Making the assumption that that error code is coming from bc, you could try:
awk -F'|' -v dqANDms='["-]' '
BEGIN { f=156
printf("s=0\n")
}
NR > 2 {gsub(dqANDms, "", $f)
...
4,157
Posted By Don Cragun
Assuming that you're using the tail in the...
Assuming that you're using the tail in the command line:
tail -n +2 <File_Name> |nawk -F"|" -v '%.2f' qq='"' '{gsub(qq,"");sa+=($156<0)?-$156:$156}END{print sa}' OFMT='%.5f'
to discard the 1st two...
3,101
Posted By guruprasadpr
Hi {print > "FILE"x;} -> Write every record...
Hi

{print > "FILE"x;} -> Write every record to the file "FILE"x where x is 1,2,3 and so on. x starts with 1 and gets incremented for every 4 records.

!(NR%4){print "PAGE "x > "FILE"x;x++;} ->...
201,841
Posted By stanleypane
^M is a carriage return. You should...
^M is a carriage return.

You should understand a few things first:

CR = \r = Carriage Return
LF = \n = Line Feed

In DOS, all lines end with a CR/LF combination or \r\n.
In UNIX, all lines...
201,841
Posted By Franklin52
To find whether a file has a CR or not you can...
To find whether a file has a CR or not you can use grep, this should print the lines with a CR:

grep '^M' file1Type <Ctr-v><Ctr-m> to get ^M and not a ^ and an M.

Regards
11,397
Posted By chidori
Hi , i got this solution from one of this...
Hi ,

i got this solution from one of this forum post.


30 17 8-14,22-28 * * [ `date +\%u` -eq 6 ] && /rebootscript



So , will this also reboot the server on 2nd and 4th saturday ?
3,101
Posted By guruprasadpr
Hi $ cat file 1 2 3 4 5 6 7...
Hi


$ cat file
1
2
3
4
5
6
7
8
9
10


$ awk '{print > "FILE"x;}!(NR%4){print "PAGE "x > "FILE"x;x++;}END{print "PAGE "x > "FILE"x}' x=1 file

$ cat FILE1
1
8,789
Posted By guruprasadpr
Hi Try doing something like this: ...
Hi

Try doing something like this: https://www.unix.com/shell-programming-scripting/15520-cron-schedule-1st-wednesday-every-month.html...
20,057
Posted By radoulov
You can use something like this: awk 'END {...
You can use something like this:

awk 'END { printf "E%03d end\n", c > f }
!(NR % 200) || NR == 1 { if (f) { printf "E%03d end\n", c > f; close(f) }
printf "E%03d start\n", ++c > (f = "file" c...
Showing results 1 to 11 of 11

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