Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Raw extraction problems with dcraw Post 303024607 by Mechaniac on Friday 12th of October 2018 12:17:04 PM
Old 10-12-2018
Raw extraction problems with dcraw

Hi,


I'm really a newbie in linux system! Please bear with me.
The problem is every time I run the shell script, it deletes all the files in the target directory and left one D source code type file with name: *.ppm.d.

Can anyone help me with this??
Thanks in advance!





what I'm trying to do is:
1. use dcraw to extract all *.raw in one directory. outputs are *.ppm. (The shell script let you type in the directory to work in)

2. remove all *.raw
3. doing a bit image processing with double.c(outputs are *.d)

4. remove all *.ppm files

5. remove *.d extension of all files



Here is the code:

Code:
#!/bin/sh
cd /home/pi/dcraw/
echo "Enter target directory: "
read filename


for file in "$filename/*.raw";
do
./dcraw "$file";
done


cd $filename
rm *.raw


for file in "$filename/*.ppm";
do
double $file > ${file}.d;
done


rm *.ppm


for file in "$filename/*.d";
do
mv -- "$file" "${file%%.d}";
done

 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Raw vs. Filesystem?

Maybe this is the wrong forum to start this debate and I apologize if it is, but I have been wondering for some time which is better to use for a database, raw or filesystem? By better I mean don't just mean better performance but also ease of maintenance, etc. I know that several years ago it... (5 Replies)
Discussion started by: keelba
5 Replies

2. Solaris

About raw partition

Hi I have solaris 8 installed on Intel machine. the disk I have is IDE. I would like to know how can I create a raw partition on an IDE disk. Regards, Raja (2 Replies)
Discussion started by: RajaRC
2 Replies

3. AIX

Raw I/o

Is there any system call available in AIX to read the size of raw disk? If I use the command "lspv -L",it only gives size of PVs on which file system is there. I need to extract the size raw disk i.e. file system is not there on the disk. Thanks, Megha (6 Replies)
Discussion started by: MeghaV
6 Replies

4. UNIX for Dummies Questions & Answers

Using the Raw command

Hi, What is a Raw command and how does it work? We have to print out a large report from our database numerically and wanted to know how it can be done. :confused: (1 Reply)
Discussion started by: nov_user
1 Replies

5. Filesystems, Disks and Memory

Raw volumes

The query is as follows : A typical server configs when using Oracle or any other type of DB is to install the OS + DB binaries on the internal disks of the relevant server e.g. Disk 1 : OS + SW + DB binaries Disk 2 : Mirror of disk 1 (used for resiliency) Then one uses an external array... (1 Reply)
Discussion started by: kekanap
1 Replies

6. Programming

Raw devices in C

Hi guys. what is the benefits of using raw devices in programming? which applications mostly use raw devices? how can i use raw devices in C programs? is there any system calls or library functions? (1 Reply)
Discussion started by: majid.merkava
1 Replies

7. Red Hat

Raw Devices

Can you please modify my script. This script is not working for i in /dev/sdf do /bin/raw /dev/raw/`/bin/basename ${i}` ${i} /bin/sleep 2 /bin/chown orasm:ordba /dev/raw/`/bin/basename ${i}` /bin/chmod 660... (9 Replies)
Discussion started by: karthik9358
9 Replies

8. UNIX for Beginners Questions & Answers

Specify the raw format

Hey friends, i am trying to set up a raspbian wheezy vm on ma Unbuntu using qemu. when i try to run the setup command the error is: i tried to find something here in the forum but did not find anything. i was searching like 15 min pls dont roast me if there is a post explaining it. :)... (3 Replies)
Discussion started by: LinuxPlayer1809
3 Replies
Dpkg::Source::Package(3)					   libdpkg-perl 					  Dpkg::Source::Package(3)

NAME
Dpkg::Source::Package - manipulate Debian source packages DESCRIPTION
This module provides an object that can manipulate Debian source packages. While it supports both the extraction and the creation of source packages, the only API that is officially supported is the one that supports the extraction of the source package. FUNCTIONS
$p = Dpkg::Source::Package->new(filename => $dscfile, options => {}) Creates a new object corresponding to the source package described by the file $dscfile. The options hash supports the following options: skip_debianization If set to 1, do not apply Debian changes on the extracted source package. skip_patches If set to 1, do not apply Debian-specific patches. This options is specific for source packages using format "2.0" and "3.0 (quilt)". require_valid_signature If set to 1, the check_signature() method will be stricter and will error out if the signature can't be verified. copy_orig_tarballs If set to 1, the extraction will copy the upstream tarballs next the target directory. This is useful if you want to be able to rebuild the source package after its extraction. $p->get_filename() Returns the filename of the DSC file. $p->get_files() Returns the list of files referenced by the source package. The filenames usually do not have any path information. $p->check_checksums() Verify the checksums embedded in the DSC file. It requires the presence of the other files constituting the source package. If any inconsistency is discovered, it immediately errors out. $bool = $p->is_signed() Returns 1 if the DSC files contains an embedded OpenPGP signature. Otherwise returns 0. $p->check_signature() Implement the same OpenPGP signature check that dpkg-source does. In case of problems, it prints a warning or errors out. If the object has been created with the "require_valid_signature" option, then any problem will result in a fatal error. $p->extract($targetdir) Extracts the source package in the target directory $targetdir. Beware that if $targetdir already exists, it will be erased. AUTHOR
Raphael Hertzog, <hertzog@debian.org> 1.16.15 2014-06-05 Dpkg::Source::Package(3)
All times are GMT -4. The time now is 02:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy