Sponsored Content
Full Discussion: putting two images together
Top Forums Shell Programming and Scripting putting two images together Post 302673803 by Corona688 on Wednesday 18th of July 2012 12:08:51 PM
Old 07-18-2012
How about this instead?

ls lists all files in the current folder.

awk selects .cdt files, and prints the filename minus the extension.

The loop checks for prefix.cdt.png and prefix.matrix.png and, if both are present, merges them with convert.

Code:
ls | awk -F"." '/[.]cdt$/ { print $1 }' | while read PREFIX
do
        [ -f "$PREFIX".cdt.png ] || continue
        [ -f "$PREFIX".matrix.png ] || continue
        echo convert +append ${PREFIX}.cdt.png ${PREFIX}.matrix.png ${PREFIX}_merged.png
done

Remove the 'echo' once you're sure it does what you want.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Putting pC on network

How do I put a my PC with linux 7.0 on a class B network. Can someone give me info or text that will guide me? (1 Reply)
Discussion started by: Rush
1 Replies

2. UNIX for Dummies Questions & Answers

Putting Wallpaper on the Desktop

How do I put wallpaper from the internet on the Unix desktop? For example, I want to know how to perform the same operation as "right click-> Set as Wallpaper" on a graphics on a web page, in Windows. Thanks! :rolleyes: (3 Replies)
Discussion started by: pireifej
3 Replies

3. Shell Programming and Scripting

Putting a character between two other characters?

I need to separate Pascal style identifiers (TheyLookLikeThis) into words separated by an underscore (_). I've tried sed 's//&_&/' but this won't work (obviously). I'd love some help. (4 Replies)
Discussion started by: Ilja
4 Replies

4. UNIX for Dummies Questions & Answers

putting Linux on an old windows PC

Hello, I was just reading around these forums when I had an idea, without being able to really answer my question for myself due to some circumstances, so hopefully someone can give me a hand. I have an old desktop PC that has served me very well. I got an Asus G73JH though, so I mostly used the... (2 Replies)
Discussion started by: Patriots12
2 Replies

5. Programming

putting numbers behind eachother

I want to make a program where you have to insert binary numbers like this: do { iBinary = getche(); }while(iBinary == 1 || iBinary == 0); after you get the numbers I want them to be placed behind eachother so you will get: input: 1 1 0 1 output: 1101 (7 Replies)
Discussion started by: metal005
7 Replies

6. Shell Programming and Scripting

Need help putting output on one line

Good afternoon, I have been searching the web, and these forums for help. I will try my best to explain the issue, and what my desired results are. I am doing queries in MYSQL, and need the output to be sent to a file. That file needs to have things with the same ID on the same line. To... (14 Replies)
Discussion started by: brianjb
14 Replies

7. UNIX for Dummies Questions & Answers

Putting $$ before filename

Hello , I am searching a directory for a file and have to assign the filename to a variable . The variable must have form $$filename So my code is echo "'$$filename='`ls -lrt *PreMatch*.csv| head -1 | nawk '{print $9}'`" however $$ is converting to a number . How could I make it $$... (3 Replies)
Discussion started by: Pratik4891
3 Replies

8. Shell Programming and Scripting

Other way aside from putting more PIPES (|)

I already manage to get the output that i want.. but wat if removing all the pipes and convert it 1 liner with less pipes. My command below can get the ouput that i want. i just want to remove the pipes or less pipes. #cat file1 us-west-2a running i-3397a421... (2 Replies)
Discussion started by: kenshinhimura
2 Replies

9. Shell Programming and Scripting

Bash Script to find/sort/move images/duplicate images from USB drive

Ultimately, I'm looking to create a script that allows me to plug in a usb drive with lots of jpegs on it & copy them over to a folder on my hard drive. So in the process of copying I am looking to hash check them, record dupes to a file, copy only 1 of the identical files (if it doesn't exsist... (1 Reply)
Discussion started by: JonaQuinn
1 Replies

10. Hardware

Putting an old hd in a new computer

What are the steps you need to take when you put an old HD in a new computer? I just did this. Every time it makes it to the windows boot screen then restarts. I have a bunch of old engineering software that is not compatible with the newer versions of windows. I figured this out after I bought... (6 Replies)
Discussion started by: cokedude
6 Replies
ARRAYOBJECT.NATCASESORT(3)						 1						ARRAYOBJECT.NATCASESORT(3)

ArrayObject::natcasesort - Sort an array using a case insensitive "natural order" algorithm

SYNOPSIS
public void ArrayObject::natcasesort (void ) DESCRIPTION
This method is a case insensitive version of ArrayObject::natsort. This method implements a sort algorithm that orders alphanumeric strings in the way a human being would while maintaining key/value asso- ciations. This is described as a "natural ordering". PARAMETERS
This function has no parameters. RETURN VALUES
No value is returned. EXAMPLES
Example #1 ArrayObject.natcasesort(3) example <?php $array = array('IMG0.png', 'img12.png', 'img10.png', 'img2.png', 'img1.png', 'IMG3.png'); $arr1 = new ArrayObject($array); $arr2 = clone $arr1; $arr1->asort(); echo "Standard sorting "; print_r($arr1); $arr2->natcasesort(); echo " Natural order sorting (case-insensitive) "; print_r($arr2); ?> The above example will output: Standard sorting ArrayObject Object ( [0] => IMG0.png [5] => IMG3.png [4] => img1.png [2] => img10.png [1] => img12.png [3] => img2.png ) Natural order sorting (case-insensitive) ArrayObject Object ( [0] => IMG0.png [4] => img1.png [3] => img2.png [5] => IMG3.png [2] => img10.png [1] => img12.png ) For more information see: Martin Pool's Natural Order String Comparison page. SEE ALSO
ArrayObject::asort, ArrayObject::ksort, ArrayObject::natsort, ArrayObject::uasort, ArrayObject::uksort. PHP Documentation Group ARRAYOBJECT.NATCASESORT(3)
All times are GMT -4. The time now is 05:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy