Sponsored Content
Top Forums Shell Programming and Scripting cp not dealing with variable properly? please help Post 302506262 by orochinagi on Saturday 19th of March 2011 03:41:58 PM
Old 03-19-2011
cp not dealing with variable properly? please help

I am having trouble with a script that is supposed to :

a)take all the jpg pictures in a given directory/parameter and create thumbnails of it in a directory on the desktop.

e.g
from /here/are/the/files.jpg to ~/Desktop/parser-the/files.png

this is my script: all the individual parts work but it falls apart when i put them together Smilie any help would be appreciated Smilie

Code:
  for picturesource in $(ls ${1}/*.[jJ][pP][gG])
                do
                        echo this is the picturesource $picturesource;
                        destination=~/Desktop/parser-"${picturesource}";
                        echo this is the destination $destination;
                        /bin/cp -Rf ${picturesource} ${destination}  && echo cp done ;
                        basenames=`basename ${destination}`;
                        echo this is basename $basenames;
                        echo eval="convert -thumbnail 137 $picturesource ${destination}.png" && echo eval and it goes here $destination;
                        ls ~/Desktop/parser* && echo now listing files in the folder
                        sleep 1
                done

Heres the output:

Code:
this is the picturesource test/hdgef.jpg
this is the destination /home/arbutt1/Desktop/parser-test/hdgef.jpg
/bin/cp: cannot create regular file `/home/arbutt1/Desktop/parser-test/hdgef.jpg': No such file or directory
this is basename hdgef.jpg
eval=convert -thumbnail 137 test/hdgef.jpg /home/arbutt1/Desktop/parser-test/hdgef.jpg.png
eval and it goes here /home/arbutt1/Desktop/parser-test/hdgef.jpg
/home/arbutt1/Desktop/parser-
now listing files in the folder

any help would be extremely appreciated Smilie

Last edited by orochinagi; 03-19-2011 at 05:22 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help in dealing with arra

I am readinga file lin by line and based craeting a arry of unique elemenst from the second column of the line. However when i coem out of the while loop my array becomes empty , can eny one tell me what I would be doing wrong #!/bin/bash logfile="./mylog.dat" begin=100 end="$(( $begin +... (5 Replies)
Discussion started by: jojan
5 Replies

2. Shell Programming and Scripting

Dealing with log files

Hi , My requirement is that i need to search for a number of strings in a log file and print them with line numbers.The search should be date wise. The sample log file is : Jan 17 02:45:34 srim6165 MQSIv500: (UKBRKR1P_B.LZ_ BENCHMARKS)BIP2648E: Message backed out to a queue; node... (6 Replies)
Discussion started by: charudpss
6 Replies

3. UNIX and Linux Applications

webinject - dealing with popups

Hello We have a webapp that launches a link in a popup. We need to use webinject to check the content of that popup but have been so far unsuccessful. We use webinject as a nagios plugin. Does anyone have any experience of using/configuring webinject and know if this is possible or not? ... (1 Reply)
Discussion started by: skewbie
1 Replies

4. Shell Programming and Scripting

AWK: pattern not properly stored in variable?

Hey there, I have a table of contents file of the form 1 Title1 1.1 Subtitle1 1.1.1 Subsubtitle1 1.1.2 Subsubtitle2 ... and want to count the number of dots in the first field to find out the level of the section. I use the gsub function for the job, which works if I pass the pattern... (2 Replies)
Discussion started by: herrsimon
2 Replies

5. Shell Programming and Scripting

Dealing with files with spaces in the name

Hello, I'm a computer science major and I'm having problems dealing with file names with spaces in them. Particularly I'm saving a file name in a variable and then using the variable in a compare function i.e. a='te xt.txt' b='file2.txt' cmp $a $b If anyone could help me with this particular... (10 Replies)
Discussion started by: jakethegreycat
10 Replies

6. Programming

Need help with Card Dealing Program

I'm currently making a card dealing program, it is suppose to display a list of cards like this: "Ace of Heart, is red" "Two of Heart, is red" . . "Ace of Spade, is black" and so on for all suits and numbers. here is my current code: #include <stdio.h> #include <stdlib.h> #include... (3 Replies)
Discussion started by: Izzy123
3 Replies

7. Shell Programming and Scripting

variable option not properly recognized

I'm creating a junk script which utilizes either -l or -p to list files or remove files, respectively, in the junk directory. When I run this code, inputting '-p' is unrecognized through the whole if/else block and falls to the last else (echo do nothing). In addition, I switched tests and tested... (2 Replies)
Discussion started by: haishuva
2 Replies

8. UNIX for Dummies Questions & Answers

Dealing with sum

I have file input 1/1/2013 1AS030A 0 1083 CHINA 1/1/2013 1AS030B 0 675 KOREA 1/1/2013 1AS035A 162 662 CHINA 1/1/2013 1AS035B 51 799 INDIA 1/1/2013 1AS035C 0 731 CHINA 1/2/2013 1AS073A 10 1375 KOREA... (5 Replies)
Discussion started by: radius
5 Replies

9. Shell Programming and Scripting

Dealing with edge-list

I have an edge-list with nodes, edge.txt A B B J J H C A G H G A A C K G I have another file which tells me which of these nodes are important, input.txt G C A (3 Replies)
Discussion started by: Sanchari
3 Replies

10. Programming

Dealing with XML comments

I'm writing my own simple XML parser as an experiment. It's a lot more complicated than it's supposed to be. Things supposedly forbidden in XML comments happen all the time in the wild. You're never, ever supposed to find -- inside <!-- xml comments --> but in practice, you don't just find... (2 Replies)
Discussion started by: Corona688
2 Replies
OGGTHUMB(1)							   User Manuals 						       OGGTHUMB(1)

NAME
oggThumb - creates thumbnails from an ogg video file SYNOPSIS
oggThumb [options] file1.ogv [ file2.ogv [ file3.ogv [...] ] ] DESCRIPTION
oggThumb creates Thumbnails from one or more ogg video files, at a given time position or a given frame number. It is also possible to cre- ate a series of thumbnails at different time or frame positions. The pictures can be created in JPG or PNG format and can be resized to any given size. The default naming of each thumbnail series follows the following rule: <filename_without_extension>_x.<picture_extension> Where x starts with 0 and is incremented with every created thumbnail. So the thumbnails are successivly numbered by the appearence order. This is even valid, if time positions and frame numbers are mixed. OPTIONS
-t Time at which a thumbnail should be created. More than one thumbnail time can be concatenated by commas. The times can be set by integer or floating point values in seconds. If the time is not exactly matching, the next frame is used. The times don't have to be sorted incrementally. Example: -t 12.4,14.157,13.23 -f Number of a frame that should be created as a thumbnail. More than one thumbnail frame can be concatenated by commas. The frame num- bers must be an integers. The frame numbers don't have to be sorted incrementally. Example: -f 12000,13000,11000 -s Picture output size. The thumbnail is created in the size given as <width>x<height>. If you want to include the thumbnails into your webpage and you need to have a fixed width but dynamic height, you can set the dynamic axis to 0. So the aspect ratio of the video frame is kept. This is the same for setting width or height to 0. Example: -s 0x100 -o Output format. This can be png or jpg. The default is jpg. Example: -o png -n Alternative thumbnail picture name. The % can be used within the name to indicate the counter placeholder. In case of more than one video file, the counter continuous throughout the different videos, so that the pictures are not overwrit- ten. If the name has an extension. This extension is used to identify the output picture format. Example: -n myNo_%_thumb EXAMPLE
oggThumb -t 10.3,22.4,31.9,43.4,59.4 -f 1200 -s 0x100 myFile.ogv oggThumb -f 200,400,300,100 -t 3.54 -n %_thumb.png myfile.ogv mysecondfile.ogv AUTHOR
Joern Seger <yorn at gmx dot net> SEE ALSO
oggCut(1), oggCat(1), oggJoin(1), oggSplit(1), oggTranscode(1), oggSlideshow(1), oggSilence(1) Linux JAN 2010 OGGTHUMB(1)
All times are GMT -4. The time now is 10:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy