Sponsored Content
Top Forums Shell Programming and Scripting Convert creates multiple files Post 303027169 by bakunin on Monday 10th of December 2018 10:34:47 AM
Old 12-10-2018
Quote:
Originally Posted by Kangol
GNU Trisquel 7.0 with Gnome Version 3.8.4running bash
Well, in this the bash version. You see why it is necessary to state your surroundings?

Code:
bakunin@host $ cat myconvert.sh
#! /bin/bash
local fIn="$1"
local chExt=".png"
fIn="${fIn#${chExt}}"

if ! [ -f "${fIn}.${chExt}" ; then
     echo "Cannot find file ${fIn}.${chExt}." >&2
     exit 1
fi
if convert "$fIn.$chExt" -crop 3000x4500 +repage -format png "${fIn}--cr.${chExt}" ; then
     rm "${fIn}-cr-1.${chExt}"
     rm "${fIn}-cr-2.${chExt}"
     rm "${fIn}-cr-3.${chExt}"
     mv "${fIn}-cr-0.${chExt}" "${fIn}-cr.${chExt}"
     exit 0
fi

exit $?

Quote:
Originally Posted by Kangol
The task is to understand how it is creating the additional files, what are they? Has anybody encountered them before?
I also want to understand if my image is created properly. Are the headers correct, offset etc
This is a question best asked an expert in picture processing. I have never used this (or any other picture processing) program at all.

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

gVim creates and leaves strange tilde ~ files in Windows

Hey folks, I have used gVim in Windows for many years but I have never found an answer to a very simple question I am going to ask you guys... My question is if there is a way to eliminate the creation of those ~ files that gVim creates in Windows. If you have ever used gVim in Windows you... (2 Replies)
Discussion started by: ghbarratt
2 Replies

2. UNIX for Dummies Questions & Answers

SCO 5.0.7 Cron creates files with 600, need 644

Hi, I've searched and read, and searched and read some more; but I'm still not connecting the dots or understanding what I need to change. I have a script that creates a file. If I run it as root, the file gets created with 644 permissions like I want. That seems to make sense (at least I... (2 Replies)
Discussion started by: 65bit
2 Replies

3. UNIX for Dummies Questions & Answers

naming files that csplit creates

Hi, This is my first time on this forum.. I searched the previous answers, but didn't find the answer I was looking for at first glance. csplit works beautifully for me, except for one thing. My file looks like this: ad|name1|asdf...(several pages)..asdf ... ad|name2|asdf...(several... (8 Replies)
Discussion started by: juliette salexa
8 Replies

4. Shell Programming and Scripting

Cannot get to convert multiple spaces to one space

Hi Guys, I am using a Redhat Linux Centos machine and trying to convert multiple spaces in a file to one space. I am using: sed '/./,/^$/!d' input_file > output_file I also tried cat -s Both gave me no change in the output file. I tried this on cygwin and it worked... (7 Replies)
Discussion started by: npatwardhan
7 Replies

5. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

6. Shell Programming and Scripting

awk, multiple files input and multiple files output

Hi! I'm new in awk and I need some help. I have a folder with a lot of files and I need that awk do something in each file and print a new file with the output. The input file name should be modified when I print the outpu files. Thanks in advance for help! :-) ciao (5 Replies)
Discussion started by: gabrysfe
5 Replies

7. Shell Programming and Scripting

How to convert multiple number ranges into sequence?

Looking for a simple way to convert ranges to a numerical sequence that would assign the original value of the range to the individual numbers that are on the range. Thank you given data 13196-13199 0 13200 4 13201 10 13202-13207 3 13208-13210 7 desired... (3 Replies)
Discussion started by: jcue25
3 Replies

8. UNIX for Advanced & Expert Users

Allow user without dir write permission to execute a script that creates files

In our project we have several unix scripts that trigger different processes. These scripts write logs to a particular folder 'sesslogs', create output data files in a separate directory called 'datafiles' etc. Usually L1 support team re-run these scripts . We donot want L1 support team to have... (14 Replies)
Discussion started by: waavman
14 Replies

9. Shell Programming and Scripting

Convert single column into multiple rows

Convert Single column to multiple rows file a.txt contains data like below Server=abc Run=1 Tables=10 Sessions=16 Time=380 Jobs=5 Server=abc Run=2 Tables=15 Sessions=16 Time=400 Jobs=5 Server=abc Run=3 Tables=20 Sessions=16 Time=450 (5 Replies)
Discussion started by: sol_nov
5 Replies

10. Shell Programming and Scripting

Grep strings on multiple files and output to multiple files

Hi All, I want to use egrep on multiple files and the results should be output to multiple files. I am using the below code in my shell script(working in Ksh shell). However with this code I am not attaining the desired results. #!/bin/ksh ( a="/path/file1" b="path/file2" for file in... (4 Replies)
Discussion started by: am24
4 Replies
read-notepad(1) 					      General Commands Manual						   read-notepad(1)

NAME
read-notepad - Connect to the Palm handheld device and list the record information found in the Notepad application. Alternately, if no options are given, each record's image will be converted to files, using Portable Network Graphic (.png) or Portable Pixmap (.ppm) format. The default type is ppm. SYNOPSIS
read-notepad -p <port> --list --type <type> DESCRIPTION
read-notepad allows a PalmOS 4.0 or later user to read the data stored in the Palm Notepad application and extract the data into images and convert them to Portable Network Graphics (.png) or Portable Pixmap (.ppm) files. OPTIONS -p --port <port> Use device file port to communicate with the Palm handheld device. If this is not specified, will look for the $PILOTPORT environ- ment variable. If both are not found, will fall back to /dev/pilot. -h --help Display help synopsis for read-notepad -v --version Display version of read-notepad -l --list List picture information found on the device instead of converting them to image files -t --type <type> Specify the output picture type. Can be either "png" or "ppm". USAGE
The program will connect to the target Palm handheld device, and list or convert the records and images found in the Palm Notepad applica- tion to Portable Network Graphic (.png) or Portable Pixmap (.ppm) files. KNOWN BUGS
read-notepad has no known bugs. REPORTING BUGS
Report bugs at http://bugs.pilot-link.org/ AUTHOR
read-notepad was written by Angus Ainslie <angusa@deltatee.com>. Free Software Foundation Palm Computing Device Tools read-notepad(1)
All times are GMT -4. The time now is 08:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy