Public feed
#890939
(09:07:19 PM) him: can I ask you a linux related question?
(09:07:24 PM) me: sure
(09:07:26 PM) me: what you want?
(09:07:34 PM) him: I am surprised I have never had the need before now, but I am using the command "ps2pdf" to convert PS documents into PDF's, do you know if there is an easy way for me to do it to more than one at a time, or ideally a whole folder of files
(09:08:06 PM) me: for P in *.pdf ; do ps2pdf $P ; done
(09:08:26 PM) me: where *.pdf is actually *.ps, or your list of files separated by spaces
(09:11:20 PM) him: I typed "ps2pdf *.ps" while in the directory, I don't think I am following
(09:11:31 PM) me: what?
(09:11:42 PM) me: why'd you do that?
(09:11:45 PM) him: I don't think I understand what I am supposed to do
(09:11:52 PM) me: did you see what I typed?
(09:12:09 PM) me: why did you ignore it and type something else?
(09:12:09 PM) him: "I don't think I understand"
(09:12:15 PM) me: for P in *.pdf ; do ps2pdf $P ; done
(09:12:20 PM) me: type ___THAT___
(09:12:27 PM) me: actually
(09:12:34 PM) me: for P in *.ps ; do ps2pdf $P ; done
(09:12:37 PM) me: type ___THAT___
(09:13:07 PM) him: brian@Vera:~/Desktop/ECON100$ *.ps ; do ps2pdf $P ; done
bash: syntax error near unexpected token `do'
(09:13:24 PM) me: no you fucking idiot
(09:13:24 PM) him: typing "for P in *.ps ; do ps2pdf $P ; done" made it mad at me
(09:13:30 PM) me: what'd it say?
(09:14:04 PM) me: what shell are you using?
(09:14:14 PM) him: Error: /undefinedfilename in (*.ps)
http://www.w3.org/1999/xhtml'/>Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:1152/1684(ro)(G)-- --dict:0/20(G)-- --dict:92/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript SVN PRE-RELEASE 8.61: Unrecoverable error, exit code 1
brian@Vera:~/Desktop/ECON100$ for P in *.ps ; do ps2pdf $P ; done
Error: /undefinedfilename in (*.ps)
http://www.w3.org/1999/xhtml'/>Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:1152/1684(ro)(G)-- --dict:0/20(G)-- --dict:92/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript SVN PRE-RELEASE 8.61: Unrecoverable error, exit code 1
brian@Vera:~/Desktop/ECON100$ *.ps ; do ps2pdf $P ; done
bash: syntax error near unexpected token `do'
brian@Vera:~/Desktop/ECON100$ for P in *.ps ; do ps2pdf $P ; done
Error: /undefinedfilename in (*.ps)
http://www.w3.org/1999/xhtml'/>Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:1152/1684(ro)(G)-- --dict:0/20(G)-- --dict:92/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript SVN PRE-RELEASE 8.61: Unrecoverable error, exit code 1
brian@Vera:~/Desktop/ECON100$
(09:14:41 PM) me: right
(09:14:45 PM) me: what shell are you using?
(09:16:16 PM) me: ?
(09:16:30 PM) him: sorry, had to run away for a sec
(09:16:36 PM) him: bash? is that what your after
(09:16:43 PM) me: yeah are you using bash?
(09:16:48 PM) him: yes
(09:16:50 PM) me: ok
(09:17:46 PM) me: please paste the entire line (one line, including prompt) where you entered the for statement
(09:18:45 PM) him: brian@Vera:~/Desktop/ECON100$ for P in *.ps ; do ps2pdf $P ; done
(09:18:55 PM) me: ok good
(09:19:11 PM) me: are you in the directory with the PS files?
(09:19:16 PM) him: yeah
(09:19:20 PM) me: ok good
(09:19:33 PM) me: now why doesn't that line succeed?
(09:20:10 PM) him: I feel like I am in inquiry based math again
(09:20:41 PM) me: well I feel like I can't trust you to use your brain before asking/answering questions
(09:20:52 PM) me: but I want to help you
(09:21:00 PM) me: so I have to be very explicit
(09:21:07 PM) him: and calling me a fucking idiot is the way to accomplish that I get it
(09:21:18 PM) me: why doesn't that line succeed?
(09:21:23 PM) me: haha
(09:21:29 PM) him: I cannot answer that question
(09:21:36 PM) me: why not?
(09:21:45 PM) me: what is the output?
(09:21:55 PM) him: you would like to see it again would you
(09:22:05 PM) me: pastebin it, please
(09:22:14 PM) me: my IM client screws up the formatting
(09:22:35 PM) him: http://pastebin.com/d7cd7f864 ('http://pastebin.com/d7cd7f864')
(09:22:49 PM) me: ok
(09:23:01 PM) me: now do this
(09:23:03 PM) me: ls *.ps
(09:23:09 PM) me: do you see your files?
(09:23:26 PM) him: they don't have that extension
(09:23:39 PM) me: what DO they have? .ps is what PS files should be named ...
(09:24:20 PM) me: this is what I'm talking about ... why didn't you tell me that in the first place?
(09:24:29 PM) him: if I use FF to save to a file whatever I name it is all that is there
(09:24:35 PM) him: that is still the kind of file they are
(09:24:36 PM) me: what are they called?
(09:24:45 PM) me: ok
(09:24:45 PM) me: well
(09:24:55 PM) me: I gave you a for command, right?
(09:24:57 PM) him: brian@Vera:~/Desktop/ECON100$ ls
1-28Mon 1-29Tues 1-30Wed 1-31Thurs 1-31Thurs2 2-1Fri econ100assignments
(09:25:18 PM) me: take the "*.ps" bit and replace it with the names of all the files, separated by spaces
(09:25:51 PM) me: protip: just because you don't have to have extensions on your files doesn't mean that extensions are useless
(09:26:14 PM) him: tell that to FF
(09:26:17 PM) him: *Firefox
(09:26:21 PM) me: no, that's your job
(09:26:40 PM) me: FF gave you enough rope to hang yourself with, and you did.
(09:27:09 PM) him: this began as FF not giving me an easy way to save a page as a pdf
(09:27:25 PM) me: I don't care about your FF woes ...
(09:27:32 PM) me: the web sucks and I already know that
(09:27:37 PM) him: I went to a windows box and an OSX box and both have the print as pdf right in the print window
(09:27:53 PM) him: I find that rather annoying
(09:27:59 PM) me: ok
(09:28:02 PM) me: that's nice
(09:28:44 PM) him: so there is no easy way to get that command to run itself on every file contained in a specific folder?
(09:28:58 PM) him: as they are now
(09:29:01 PM) me: yes there is
(09:29:09 PM) me: are all the files PS?
(09:29:54 PM) me: yes or no ...
(09:30:13 PM) him: yeah, but how in the hell am I supposed to even know what to name them if FF doesn't tell me what clicking the export to file box is going to do in the first place
(09:30:13 PM) me: T/F: there are _no_ non-PS files in the directory
(09:30:21 PM) me: that's not my problem
(09:30:37 PM) me: it's your filesystem, name them whatever the fuck you want
(09:30:49 PM) him: I named them .pdf
(09:30:52 PM) me: why?
(09:30:58 PM) me: they're PS
(09:30:58 PM) him: and then found out later they were ps files
(09:31:00 PM) me: ok
(09:31:04 PM) me: whatever man
(09:31:08 PM) him: because FF gave me no indication what they were going to be
(09:31:09 PM) me: whatever floats your boat
(09:31:40 PM) me: so
(09:31:47 PM) me: if they're ALL PS
(09:31:53 PM) me: replace the *.ps with *
(09:32:02 PM) me: IT'S NOT THAT HARD TO LEARN
(09:32:44 PM) him: and apparently it is hard to teach
(09:32:49 PM) me: well ...
(09:32:53 PM) me: I'm not saying any more
(09:33:01 PM) him has signed off.