Search Results

Search: Posts Made By: optik77
2,662
Posted By optik77
count files in dir except one
Hi

I need to count files in current directory, except file abc.txt, if it exists

I have such script:

FILES_COUNT=$(find * -name "*" | wc -l)

but it counts all files. I need to exclude...
6,775
Posted By optik77
OK! Thnx! But can I use such structure: if...
OK! Thnx!
But can I use such structure:

if (check_exists_of('test-string-first','filename.txt') then
MYVAR = awk .... filename.txt
echo $MYVAR
else
echo 'file doesn't contain...
6,775
Posted By optik77
Find string in text file
Hello!

Please, help me to write such script.
I have some text file with name filename.txt
I must check if this file contains string "test-string-first", I must cut from this file string which...
2,577
Posted By optik77
No, there aren't. only ...
No, there aren't.
only
folder1/subfolder/file.(txt|pdf)
2,577
Posted By optik77
yes! you are right! subfolder must contain only...
yes! you are right!
subfolder must contain only 2 files: one TXT and one PDF.
2,577
Posted By optik77
Corona688...
Corona688 (https://www.unix.com/members/43551.html) OK, sorry)

It means a folder beside subfolder.
Example ($HOME/folder1 has 4 subfolders: 33456, 9876, 5677, 3456):

$HOME/folder1/33456/abc.pdf...
2,577
Posted By optik77
Some manipulations with files and folders. (loop, find, create and remove)
Hello!

I need to realize such task.

1. In my user's home dir I have folder1;
2. In folder1 I have some (various count) subfolders with random names;
3. In these subfolders I have one file...
6,174
Posted By optik77
Corona688, Sorry, but I get next warning ...
Corona688,
Sorry, but I get next warning
alex@alex:~/123$ . test.sh
bash: test.sh: string 23: Syntax error: word unexpected (expecting ")")
bash: test.sh: string 23: ` echo "</file>" ) >...
4,487
Posted By optik77
No! I get attachment and full message copy...
No!

I get attachment and full message copy only from user2!
From user1 I don't get anything..

I think that problem in next: when I send mail from user3 to user1, it firstly resends to...
6,174
Posted By optik77
.PDF and .TXT to .XML. Is it possible?
Hi!

I need to realize this task.
In folder i have such files:
name1.txt
name1.pdf
name2.txt
name2.pdf
etc...

I want to scan this folder, match files with same name (name1.txt with...
4,783
Posted By optik77
for ... do - syntax
hi!

pls help me :)


cd folder
for f in *; do
...
done

this circle takes all files from folder1
i need only .pdf files
but it may be like a.pdf or a.PDF

what syntax must i use?
...
4,487
Posted By optik77
Problem with saving mails (fetchmail + procmail + uudeview)
Hello!

I try to save attachments from mails (pop3/imap) to folders.
I have 2 emails, which i want to scan:
user1@host_address
user2@host_address

I use next .fetchmailrc configuration

...
4,800
Posted By optik77
thank you, friends :)
thank you, friends :)
4,800
Posted By optik77
Copy file to two folders with condition
Hello!

Please, help me write this simple script using bash scripting.

Task:

In Folder1 I have files:
name1.txt, name2.txt, name3.txt .. etc
In Folder2 may located such files:
name1.txt,...
2,967
Posted By optik77
delete
delete
2,967
Posted By optik77
3,731
Posted By optik77
Copy files from one folder to another with rule
Hello!

Please, help me to find or write this simple bash-script.

I have first folder
/tmp/work/folder1
with such files:
name1.txt
name2.txt.1
name2.txt.2
name3.txt
name4.txt
name4.txt.1...
Showing results 1 to 17 of 17

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