Search Results

Search: Posts Made By: fiori_musicali
Forum: BSD 02-16-2009
2,811
Posted By fiori_musicali
OpenBSD downgrades HDD transfer mode, I want to upgrade it WITHOUT BOOTING
Hi,

I have a crappy hard disk and am trying to back up stuff from it onto my newer hopefully less crappy disk. There are dead sectors on the disk and some files can't be read (at all) so OpenBSD...
2,098
Posted By fiori_musicali
Yes! Thanks for the reply, your code is much...
Yes!

Thanks for the reply, your code is much cleaner & robust than what I came up with as a solution. Nice and compact.

Also, I didn't realize awk had arrays.

Thanks again!
2,098
Posted By fiori_musicali
The solution lied commands "sort" and "uniq": ...
The solution lied commands "sort" and "uniq":

$ for i in `ps axuc | sed '1d' | awk '{ print $11 }' | sort | uniq` ; do sum=$(ps axuc | grep $i | awk '{ do { x+=1 ; y+=$4 } while ( x < NR )} END {...
2,098
Posted By fiori_musicali
Only matching each different pattern once
I have the following snippet of script:

for i in `ps axuc | awk '{ print $11 }' | grep -c 1 awk '{ print $1 }'` ; do
ps axuc | grep $i | awk '{ do { x+=1 ; y+=$4 } while ( x < NR )} END...
13,560
Posted By fiori_musicali
How to accurately determine memory (RAM) information
I'm writing a shell script to display as much useful information on physical and virtual memory availability and usage as possible. I need a CLI tool to print these numbers for me.

The utilities...
11,571
Posted By fiori_musicali
Figured it out. for i in 1 2 3 4 5; do ...
Figured it out.

for i in 1 2 3 4 5; do
arr[$i]=$(awk 'NR=='"$i"' { print $2 }' examplefile)
print ${arr[$i]}
doneTesting...

$ cat examplefile
skipme printme1 skipmetoo...
11,571
Posted By fiori_musicali
for i in 1 2 3 4 5; do arr[$i]=$(awk...
for i in 1 2 3 4 5; do
arr[$i]=$(awk 'NR=="$i" { print $2 }' file_with_5_records)
doneGot that far.

So YES: my syntax was incorrect to begin with. I've been dabbling with programming so...
11,571
Posted By fiori_musicali
Assigning values to an array via for/while loop
I need to do something like this:

for i in 1 2 3 4 5; do
arr[$i]=$(awk 'NR="$i" { print $2 }' file_with_5_records)
done
That is, parse a file and assign values to an array in an...
Showing results 1 to 8 of 8

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