10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Here is a simplified example of my problem. Say I have the following 3 sub-directories;
./folder1
A.txt
A.sh
./folder2
B.txt
./folder3
C.txt
C.sh
I would like to list the directory names which contain both '.txt' & '.sh' type extensions. I have came up with the following code;... (8 Replies)
Discussion started by: mmab
8 Replies
2. Shell Programming and Scripting
HI,
I have some csv files with mutiple extensions, I want to remove all the extensions and keep only the .csv extension.
anybody can suggest me how to do this.
source files
1.txt.csv.txt.csv.csv.txt.csv
2.csv.txt.csv.txt.csv.txt
target
1.csv
2.csv
--Wang (1 Reply)
Discussion started by: wangkc
1 Replies
3. Debian
for media files in directory i want change every special char in name to "_" , create screenshots, get media information, then cat that info in 1 file, after that i want split (only) media files (not *.jpg,*.txt, etc.) with rar (including some file with info in each archive, and give each archive... (7 Replies)
Discussion started by: sunnymuffin
7 Replies
4. Programming
I am having problems creating multiple forks. I want create a certain number of forks, each call a program and each wait for a different value. How is this accomplished my loop is not doing the trick.
for (i = 0; i < 5; i++) {
if (fork() < 0) {
//print error
}
... (3 Replies)
Discussion started by: Vikings1201
3 Replies
5. UNIX for Dummies Questions & Answers
I copied some files to another folder, and I want to change them from .doc extensions to .txt extensions. I tried using the cp and mv commands, but it didn't work. Is it possible to change file extensions with these commands, and if so how do I do it? I tried using the * wildcard (say cp *.doc... (1 Reply)
Discussion started by: Straitsfan
1 Replies
6. Shell Programming and Scripting
I posted this already in another thread, but was told that I should create a seperate thread for the following question:
How do I strip the extension when the delimiter might occur multiple times in the filename?
For example:
I have 2 files as input for my script.
test.extension... (8 Replies)
Discussion started by: Nemelis
8 Replies
7. Shell Programming and Scripting
Hi,
I have files with names like file1.txt.txt.txt.txt and file2.txt.txt.txt.txt.txt............ (random infinite number of .txt exist).
how to truncate (mv) their names to ones with single .txt extension like file1.txt and file1.txt ? In other words, how to extract the filename upto first... (12 Replies)
Discussion started by: prvnrk
12 Replies
8. Shell Programming and Scripting
I want to make a symbolic link to a set of files in a particular directory if they exist. The number of files in the set is not known. The following script fails because it is ambigious.
if(-f dir1/*.a) then
ln -s dir1/*.a dir2/
endif
Can anyone help me?
Thanks a lot. (1 Reply)
Discussion started by: Deanne
1 Replies
9. Shell Programming and Scripting
I have a program which gets an input file (which contain a list of objects) and processes the objects one by one sequentially. However when there are many objects it is faster to split the input into smaller lists and run the program in multiple terminal sessions simultaneously. I want to know if... (2 Replies)
Discussion started by: stevefox
2 Replies
10. Shell Programming and Scripting
I want to use find to locate files with two different extensions, and run a grep on the results. The closest I have gotten is incredibly slow and ugly:
for i in `ls -laR|egrep -e '(.js|.css)'`; do find . -name $i -print|xargs grep -H searchBg; done;
This method makes my eyes bleed. Help! ;)
... (2 Replies)
Discussion started by: r0sc0
2 Replies