Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-21-2005, 11:27 PM
|
#1
|
|
LQ Newbie
Registered: Aug 2005
Location: Louisville, KY
Distribution: Debian Sarge
Posts: 29
Rep:
|
Bash Shell script
hello folks, i run debian sarge on a dual pentium pro system....
i was trying to use the "convert" command from the imagemagick package to resize the pictures from whatever size they were to 800x600 size.
I found this online:
for img in 'ls *.jpg'
do
convert -resize 800x600 $img resized-$img
done
unfortunately, this did not work. I tried single-quotes and double-quotes and neither worked.
this was entered line per line at a bash prompt (i've entered them in successfully before)
and it did not work
all files end in either .jpg or .JPG...so i am assuming that I would have to do this script twice....
does anybody have any input on what could be wrong with the script?
|
|
|
|
08-22-2005, 01:27 AM
|
#2
|
|
Senior Member
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495
Rep:
|
Not exactly hardware  but I think the original script probably had backquotes:
for img in `ls *.jpg`
But it seems easier to just use
for img in *.jpg *.JPG
as the first line.
|
|
|
|
08-22-2005, 06:59 AM
|
#4
|
|
LQ Newbie
Registered: Dec 2003
Location: Denver Co.
Distribution: RH
Posts: 3
Rep:
|
Specifically, the author wrote:
Converting sources to website size
Before I can convert all the images I manually rotate any pictures which need it using
convert -rotate 90 image.jpg image.jpg
All my cameras are over 5 megapixel and the jpgs are very large. I always scale the image to be 800x600 or 600x800. The following script converts images which are Landscape to 800x600 and Portrait to 600x800.
#!/bin/bash
for img in *.jpg;
do
export height=`identify -format %h $img`
export width=`identify -format %w $img`
let ratio=$width/$height
echo Image $img = [ $width x $height ] = $ratio
if [ $ratio == 0 ]
then
echo Portrait 0
convert $img -geometry 600x800! -format jpeg -quality 80 $img
else
echo Landscape 1
convert $img -geometry 800x600! -format jpeg -quality 80 $img
fi
done
|
|
|
|
08-22-2005, 08:32 AM
|
#5
|
|
LQ Newbie
Registered: Aug 2005
Location: Louisville, KY
Distribution: Debian Sarge
Posts: 29
Original Poster
Rep:
|
backquotes!!! I see them....
about the category, I was going to ask a question about my old thinkpad soundcard not working under sarge...but i decided that i didnt care.
|
|
|
|
08-22-2005, 08:37 AM
|
#6
|
|
LQ Newbie
Registered: Aug 2005
Location: Louisville, KY
Distribution: Debian Sarge
Posts: 29
Original Poster
Rep:
|
thanks gint...that ended up working.
then i tried the one with the backquotes and it worked too.
thanks
gint, do you have a recommendation for PHP books...or was it somebody else who said that?
|
|
|
|
08-22-2005, 08:52 AM
|
#7
|
|
Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,644
|
FYI: The backticks tell it to execute the command line inside them FIRST then do the rest of the command line.
Also `ls *.jpg *.JPG` would do it all in one for loop.
You can put quite a lot into the backticks - say you wanted to see only the files created in 2004:
`ls -l *.jpg *.JPG |grep " 2004 " |awk '{print $NF}'`
This tells it to do full directory listing, grep for only those items that have 2004 with whitespace around it (helps to eliminate 2004 embedded in the filesize name) then says to print only the last field which is the file name.
|
|
|
|
08-22-2005, 12:12 PM
|
#8
|
|
LQ Newbie
Registered: Aug 2005
Location: Louisville, KY
Distribution: Debian Sarge
Posts: 29
Original Poster
Rep:
|
thanks guys....
sorry to who-ever for me putting this in the wrong area...
|
|
|
|
08-22-2005, 04:36 PM
|
#9
|
|
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
|
If you would like a moderator to move it, you are allowed to report it yourself -- you don't have to wait for someone else to do it.
Just click on the "Report this post to a moderator" in your own post.
|
|
|
|
08-22-2005, 05:38 PM
|
#10
|
|
LQ Newbie
Registered: Aug 2005
Location: Louisville, KY
Distribution: Debian Sarge
Posts: 29
Original Poster
Rep:
|
let me make this applicable to the area then...
i have a 380XL IBM thinkpad (old--P133)
cs1432 or some old soundcard....
I installed debian on it...and the blasted soundcard will not load...
i tried OSS and alsaconf, but i get nothing....actually alsaconf never found the card...i had to manually configure it in some config file....and it *still* didn't work.
any clues?
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:54 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|