Search Results

Search: Posts Made By: blakeoft
2,866
Posted By blakeoft
Try this then: FOLDER="/nas/testfolder" ...
Try this then:

FOLDER="/nas/testfolder"
FILE=$(ls -alt ${FOLDER} | awk '$NF ~ /^Test/ {print $NF}' | head -1)
if [[ -z $FILE ]]
echo "No file name matches your pattern in $FOLDER"
else
...
2,866
Posted By blakeoft
I think I have a fix for my code above. Try this:...
I think I have a fix for my code above. Try this:
FOLDER="/nas/testfolder"
FILE=$(ls -alt ${FOLDER} | awk '$NF ~ /^Test/ {print $NF}' | head -1)
FILE_TIME=$(date --reference=$FOLDER/$FILE +%s)...
2,866
Posted By blakeoft
Try this: ls -al | awk '$NF ~ /pattern/...
Try this:

ls -al | awk '$NF ~ /pattern/ {print $7,$8,$9}' | sort -rM | head -1Long list of all files in the current directory showing hidden files. Pipe to awk. If the last field (the file names)...
2,152
Posted By blakeoft
I can help you digest it. I honestly meant to...
I can help you digest it. I honestly meant to explain every solution that I post on this site.

Most of the stuff before "if (denomy != 0)" are just variables that are used to calculate the slopes...
2,152
Posted By blakeoft
Sorry if this looks awful. It seems to work...
Sorry if this looks awful. It seems to work though.
>awk '{sumy=$2+$3+$4+$5} {sumxy=$3*3+$4*6+$5*10} {sumy2=$2*$2+$3*$3+$4*$4+$5*$5}
{denomy=(4.0*sumy2-sumy*sumy)}...
2,152
Posted By blakeoft
This will get you the slope of the least squares...
This will get you the slope of the least squares line.
>awk '{sumy=$2+$3+$4+$5} {sumxy=$3*3+$4*6+$5*10} {print $1,$2,$3,$4,$5,(4.0*sumxy-19*sumy)/(4.0*145-361)}' file.txt
t1 2 3 5 8 0.611872
t2 0...
2,467
Posted By blakeoft
Can you post a sample of file1.txt? Backticks ( `...
Can you post a sample of file1.txt? Backticks ( ` ) execute what is between them first. Since XYZ is not a command, you might have to escape the command, i.e. put a \ in front of each backtick. See...
Showing results 1 to 7 of 7

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