image
image

|


Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old August 15th, 2006, 06:33 AM
Sunnz's Avatar
Who wants a stylus?
 
Join Date: Nov 2005
Location: Canberra, Australia
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
Sunnz is on a distinguished road
sha1sum on darwin?

I tried enter the command, but it is not there... so it doesn't come with darwin? Do I need to get it from somewhere?
Reply With Quote
  #2  
Old January 29th, 2008, 03:43 AM
Sunnz's Avatar
Who wants a stylus?
 
Join Date: Nov 2005
Location: Canberra, Australia
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
Sunnz is on a distinguished road
Just incase someone searched for this and want to know how to do it, this is the command:

openssl sha1 <path/filename.ext>
__________________
[SIGPIC][/SIGPIC]

Catel - Core 2 Duo 2.0Ghz, 1GB Ram, OSX Tiger.8

AMDemon - Dual Opteron 2.6Ghz, 2GB Ram, FreeBSD 6.1
Reply With Quote
  #3  
Old January 29th, 2008, 01:26 PM
michaelsanford's Avatar
Psycholinguist
 
Join Date: Oct 2002
Location: Ottawa/Montrιal
Posts: 2,135
Thanks: 0
Thanked 0 Times in 0 Posts
michaelsanford is on a distinguished road
Very good of you to post the answer!

Incidentally, most of those shortcut commands for openssl can be re-created by either making a one-liner shell script, or through Fink (I'm pretty sure Fink includes a few shortcuts like md5sum).

For a one-liner shortcut, you could create a script called sha1sum with
Code:
#!/bin/bash
/usr/bin/openssl sha1 $1
You can replace "sha1" with any of the digests openssl supports.

Though, IMHO, this type of shortcut is really not that useful.
__________________
michaelsanford.com • Blog • Twitter • Tumblr • LinkedIn
• iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD
• iMac G4 TFT 700 MHz | MacOS X 10.3.9 | 768 MB RAM, 40 GB HDD
• AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2•120 GB RAID 1, 2•500 GB RAID 0
Reply With Quote
  #4  
Old January 29th, 2008, 07:33 PM
Sunnz's Avatar
Who wants a stylus?
 
Join Date: Nov 2005
Location: Canberra, Australia
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
Sunnz is on a distinguished road
With a bash like shell you can place the following in ~/.profile:
Code:
alias sha1="/usr/bin/openssl sha1"
Which really creates a shortcut, that's what 'alias' is for!!
__________________
[SIGPIC][/SIGPIC]

Catel - Core 2 Duo 2.0Ghz, 1GB Ram, OSX Tiger.8

AMDemon - Dual Opteron 2.6Ghz, 2GB Ram, FreeBSD 6.1
Reply With Quote
  #5  
Old January 29th, 2008, 10:19 PM
michaelsanford's Avatar
Psycholinguist
 
Join Date: Oct 2002
Location: Ottawa/Montrιal
Posts: 2,135
Thanks: 0
Thanked 0 Times in 0 Posts
michaelsanford is on a distinguished road
Quite right!

I don't use the alias directive enough to have made a correct suggestion on it. For example, I wasn't sure if you had to include a parameter variable in the alias directive like you do in a shell script (obviously not, from your example).
__________________
michaelsanford.com • Blog • Twitter • Tumblr • LinkedIn
• iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD
• iMac G4 TFT 700 MHz | MacOS X 10.3.9 | 768 MB RAM, 40 GB HDD
• AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2•120 GB RAID 1, 2•500 GB RAID 0
Reply With Quote
  #6  
Old January 30th, 2008, 12:08 AM
Sunnz's Avatar
Who wants a stylus?
 
Join Date: Nov 2005
Location: Canberra, Australia
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
Sunnz is on a distinguished road
Aha, with alias, it is like a simple replacement macro in C, the bash interpreter search for sha1, replaces it with whatever in the quote ("/usr/bin/openssl sha1") THEN it is executed.
__________________
[SIGPIC][/SIGPIC]

Catel - Core 2 Duo 2.0Ghz, 1GB Ram, OSX Tiger.8

AMDemon - Dual Opteron 2.6Ghz, 2GB Ram, FreeBSD 6.1
Reply With Quote
Reply

Thread Tools

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Darwin in VPC Nummi_G4 Unix & X11 3 May 30th, 2003 09:03 AM
Darwin i86 help VerzilliD Unix & X11 0 August 16th, 2002 10:39 AM
Welcome to Darwin! julguribye Apple News, Rumors & Discussion 11 December 19th, 2001 03:35 PM
Darwin x86 and Mac OS 10.1 jeffberg Apple News, Rumors & Discussion 2 September 14th, 2001 04:05 AM
Darwin on x86 Jujucad Mac OS X System & Mac Software 5 April 28th, 2001 03:45 AM


All times are GMT -5. The time now is 05:42 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.