Search Results

Search: Posts Made By: fox1212
4,837
Posted By fox1212
Hmmm, I don't get your substitution. Let's see: ...
Hmmm, I don't get your substitution. Let's see:
\- -> A slash
[0-9] -> A number
[0-9]* -> Zero or more numbers
. -> Any character
[^.]* -> Zero or more characters that are not a...
4,837
Posted By fox1212
Thanks, Chubler_XL. This works nearly perfectly,...
Thanks, Chubler_XL. This works nearly perfectly, except that there's more than one dash in the entries.

This would be one line:
E4-Z61-7393486-001.jpg

Buy I can just compare $1, $2 and $3.
...
4,837
Posted By fox1212
Let's see if I read this right, as it's a bit...
Let's see if I read this right, as it's a bit obscure code to me:


$1==p{print f} # Print f if $1 is equal to p
{f=$0;p=$1} # Then store the entire line in f and up to the first dash in p...
4,837
Posted By fox1212
Ok, a sample. Say this is the text file...
Ok, a sample. Say this is the text file resulting from the sorted list of the directory:

abcd-001.pdf
dfcd-003.pdf
grdr-001.pdf
grdr-002.pdf
hhgt-001.pdf
htfr-001.pdf
htfr-002.pdf...
1,626
Posted By fox1212
This would give you a count of the number of...
This would give you a count of the number of files for each different file extension you've got:


ls | perl -p -e 's/.+\.(.+?)/$1/' | sort | uniq -c


As for the loop, you can always use an...
4,837
Posted By fox1212
Finding consecutive numbers in version names on a txt file
Hi all.

I have a directory which contains files that can be versioned. All the files are named according to a pattern like this:

TEXTSTRING1-001.EXTENSION
TEXTSTRING2-001.EXTENSION...
3,806
Posted By fox1212
As a matter of fact, I've used awk because I...
As a matter of fact, I've used awk because I think it uses less resources than perl. I agree that it's easier in perl, but I'll use the script to monitorize several solaris servers, and wanted it to...
96,673
Posted By fox1212
If I understand you, you want to find the...
If I understand you, you want to find the directory 'construction' and return its path?

If so, it would be as simple as:

find / -type d -name "construction"

This can take a long time, so if...
3,806
Posted By fox1212
How to avoid a temp file
Hi all.

I want to check the free space on a given FS and process the output. Right now, I'm using a temp file to avoid using df twice. This is what I'm doing


#!/usr/bin/ksh
...
df -k...
Showing results 1 to 9 of 9

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