The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
converting config file to csv format zer0dvide Shell Programming and Scripting 7 03-21-2008 10:33 AM
Converting a Delimited File to Fixed width file raghavan.aero Shell Programming and Scripting 2 06-06-2007 02:44 PM
Converting Pivot file to flat file vskr72 Shell Programming and Scripting 2 10-18-2005 04:41 PM
Converting a .job file Juliette Windows & DOS: Issues & Discussions 6 12-04-2004 02:42 PM
converting file systems (FAT32 to NTFS) hdk_mkr Filesystems, Disks and Memory 0 05-22-2004 01:04 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-27-2006
jasjot31 jasjot31 is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 9
Converting ps file to pdf

I have a number of post script files (*.ps) which I need to convert into Pdf.

I am using the ps2pdf command for this, but the trouble is that this commands takes only one input at a time. So the command

ps2pdf *.ps doesnt work.

how can I make a script which will take each .ps file from current directory and feed it to ps2pdf command??
  #2 (permalink)  
Old 09-27-2006
Yogesh Sawant's Avatar
Yogesh Sawant Yogesh Sawant is offline Forum Staff  
Part Time Moderator and Full Time Dad
  
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 1,086
Here's the simplest way to do so:

#!/bin/sh
for psfile in `ls -1 *ps`
do
ps2pdf $psfile
done
  #3 (permalink)  
Old 09-27-2006
srikanthus2002's Avatar
srikanthus2002 srikanthus2002 is offline
Registered User
  
 

Join Date: Sep 2006
Location: Can u guess...!
Posts: 160
Hi,

Yogesh has given proper info but just you have to be specific
i mean , while giving file name or file extension..

use "*.ps" instead of "*ps"

#!/bin/sh
for psfile in `ls -1 *ps`
do
ps2pdf $psfile
done
  #4 (permalink)  
Old 09-27-2006
jasjot31 jasjot31 is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 9
Thanks a lot ... its working
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:18 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0