<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://localhost/mediawiki/index.php?action=history&amp;feed=atom&amp;title=PHYS_210_ASSIGNMENT_3%3A_HELP</id>
	<title>PHYS 210 ASSIGNMENT 3: HELP - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://localhost/mediawiki/index.php?action=history&amp;feed=atom&amp;title=PHYS_210_ASSIGNMENT_3%3A_HELP"/>
	<link rel="alternate" type="text/html" href="http://localhost/mediawiki/index.php?title=PHYS_210_ASSIGNMENT_3:_HELP&amp;action=history"/>
	<updated>2026-04-08T10:06:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.6</generator>
	<entry>
		<id>http://localhost/mediawiki/index.php?title=PHYS_210_ASSIGNMENT_3:_HELP&amp;diff=608&amp;oldid=prev</id>
		<title>WikiSysop: Created page with &quot;PHYS 210 WIKI --&gt; PHYS 210 HOMEWORK --&gt; here ---- I&#039;m having trouble with the format converting bash script. The biggest difficulty is in how do I get my script to und...&quot;</title>
		<link rel="alternate" type="text/html" href="http://localhost/mediawiki/index.php?title=PHYS_210_ASSIGNMENT_3:_HELP&amp;diff=608&amp;oldid=prev"/>
		<updated>2022-08-31T22:38:36Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/mediawiki/index.php/PHYS_210_WIKI&quot; title=&quot;PHYS 210 WIKI&quot;&gt;PHYS 210 WIKI&lt;/a&gt; --&amp;gt; &lt;a href=&quot;/mediawiki/index.php/PHYS_210_HOMEWORK&quot; title=&quot;PHYS 210 HOMEWORK&quot;&gt;PHYS 210 HOMEWORK&lt;/a&gt; --&amp;gt; here ---- I&amp;#039;m having trouble with the format converting bash script. The biggest difficulty is in how do I get my script to und...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[PHYS 210 WIKI]] --&amp;gt; [[PHYS 210 HOMEWORK]] --&amp;gt; here&lt;br /&gt;
----&lt;br /&gt;
I&amp;#039;m having trouble with the format converting bash script. The biggest difficulty is in how do I get my script to understand what a user is inputting. The file that the user wants to convert can be named anything, and so I don&amp;#039;t get how to make my script understand that whatever file it is, it&amp;#039;s got to convert that into pdf. &lt;br /&gt;
&lt;br /&gt;
I suspect that it&amp;#039;s something like %&amp;amp;  with a * in there but I&amp;#039;m still lost. Any help on this will be appreciated greatly!!!&lt;br /&gt;
[[User:S44535078|S44535078]] 02:29, 21 September 2008 (PDT) (actually signed post on 22nd..)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;FONT COLOR=darkgreen&amp;gt; Please &amp;quot;date &amp;amp; sign&amp;quot; your entries by ending them with four consecutive tildes (&amp;quot;~&amp;quot;) -- &amp;lt;/FONT&amp;gt; [[User:Jess|Jess]] 07:55, 21 September 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;FONT COLOR=purple&amp;gt; You should look at the usage manual section of [http://www.imagemagick.org www.imagemagick.org] to get familiar with the way &amp;#039;&amp;#039;ImageMagick&amp;#039;&amp;#039; works, and then maybe try and use some of its commands in the terminal (in our case the command is of the form &amp;lt;tt&amp;gt;convert file1.ext1 file2.ext2&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&amp;lt;BR&amp;gt; &amp;lt;FONT COLOR=darkgreen&amp;gt; (To get quick help on the syntax and options of &amp;#039;&amp;#039;convert&amp;#039;&amp;#039;, just enter &amp;lt;tt&amp;gt;convert&amp;lt;/tt&amp;gt; on the command line, with no arguments, and it will print several pages of help.)  -- [[User:Jess|Jess]] 10:11, 21 September 2008 (PDT) &amp;lt;/FONT&amp;gt; &amp;lt;BR&amp;gt;&lt;br /&gt;
When you use a command in that format, everything after the first word (which invokes the command) is an input argument.  As far as your shell script is concerned, these can be referred to as variables &amp;lt;tt&amp;gt;$1, $2, $3&amp;lt;/tt&amp;gt;, and so on (&amp;lt;tt&amp;gt;$#&amp;lt;/tt&amp;gt; is the &amp;#039;&amp;#039;number&amp;#039;&amp;#039; of such variables sent as input).  In our case the only argument is the image file name in the format &amp;lt;tt&amp;gt;file.extension&amp;lt;/tt&amp;gt; because the problem already defined the second argument in the convert command to be &amp;lt;tt&amp;gt;file.pdf&amp;lt;/tt&amp;gt;.  So the file name that&amp;#039;s being supplied by the user in our case will be &amp;lt;tt&amp;gt;$1&amp;lt;/tt&amp;gt; in the script.  To get &amp;lt;tt&amp;gt;file&amp;lt;/tt&amp;gt; out of &amp;lt;tt&amp;gt;file.ext&amp;lt;/tt&amp;gt; you can assign a variable in the script that cuts a part of the argument off: &amp;#039;&amp;#039;&amp;#039;&amp;lt;tt&amp;gt;fn=`echo $1 | cut -d &amp;quot;.&amp;quot; -f1`&amp;lt;/tt&amp;gt;&amp;#039;&amp;#039;&amp;#039; (this was on the whiteboard last lab, and &amp;lt;tt&amp;gt;fn&amp;lt;/tt&amp;gt; is the variable).  I think you should try and see what &amp;lt;tt&amp;gt;echo $1 | cut -d &amp;quot;.&amp;quot; -f1&amp;lt;/tt&amp;gt; does on its own in the terminal, and maybe play with the other cut options as well (change the delimiter character in &amp;quot; &amp;quot;, change &amp;lt;tt&amp;gt;f1&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;f2&amp;lt;/tt&amp;gt;, &amp;#039;&amp;#039;etc.&amp;#039;&amp;#039;).&lt;br /&gt;
&amp;lt;BR&amp;gt; &amp;lt;FONT COLOR=darkgreen&amp;gt; There are other ways to parse &amp;lt;tt&amp;gt;file.ext&amp;lt;/tt&amp;gt; and extract the part to the left of the period, but now that I&amp;#039;ve seen it I like the &amp;lt;tt&amp;gt;cut&amp;lt;/tt&amp;gt; method better, because it is more mnemonic (albeit more wordy).  Both will be described on the homework solutions to be posted Tuesday.  -- [[User:Jess|Jess]] 10:11, 21 September 2008 (PDT) &amp;lt;/FONT&amp;gt; &lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m not sure if that&amp;#039;s exactly what you were asking, so I hope I gave the answer somewhere in there. [[User:S48394076|S48394076]] 08:23, 21 September 2008 (PDT) &amp;lt;/FONT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In assignment 4, do you want us to generate a list of factorials?  Or do you want us to extract a list of factorials. [[User:S15118078|highknees]] 14:49, 22 September 2008 (PDT)&lt;br /&gt;
&amp;lt;FONT COLOR=darkgreen&amp;gt; Extract from where?  I don&amp;#039;t understand your question, but I&amp;#039;m pretty sure the answer is &amp;quot;generate&amp;quot;.  -- &amp;lt;/FONT&amp;gt; [[User:Jess|Jess]] 18:00, 22 September 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;FONT COLOR=purple&amp;gt; I&amp;#039;m having trouble checking that the input for my factorial script is all numbers.&lt;br /&gt;
So far I&amp;#039;ve got something along the lines of &amp;#039;&amp;#039;if [[ &amp;quot;$1&amp;quot; = [0-9] ]] ...&amp;#039;&amp;#039; but that only tests the first character. I think there is some operator that would go in the format &amp;#039;&amp;#039;[0-9]&amp;#039;&amp;#039;&amp;#039;something&amp;#039;&amp;#039;&amp;#039;[0-9]&amp;#039;&amp;#039; that would test all the characters successively. Ideally if would have just used &amp;#039;&amp;#039;&amp;#039;=~&amp;#039;&amp;#039;&amp;#039; but our version of bash doesn&amp;#039;t seem to support it (bash 3.0 from 2004 is supposed to support the &amp;quot;contains&amp;quot; operator).&lt;br /&gt;
&lt;br /&gt;
Anybody solved that issue yet? &amp;lt;/FONT&amp;gt; [[User:S48394076|S48394076]] 16:55, 22 September 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;FONT COLOR=darkgreen&amp;gt; This probably doesn&amp;#039;t need to be tested explicitly.  I believe anything that is not an integer will either generate an error message (which serves your purpose fine) or be interpreted as a zero, which may also be OK.  -- &amp;lt;/FONT&amp;gt; [[User:Jess|Jess]] 18:00, 22 September 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Moved from [[P210 WIKI: talk]] page: &amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
Hello,&lt;br /&gt;
&lt;br /&gt;
I was wondering if anyone was around, and willing, this weekend to help me with assignmnet 3.&lt;br /&gt;
I am completely new to computer land, except the basic necessities like MSN and Facebook, jk.&lt;br /&gt;
&lt;br /&gt;
Please let me know,&lt;br /&gt;
&lt;br /&gt;
Shauna&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
</feed>