Sponsored Content
Full Discussion: Problem with cut command
Top Forums Shell Programming and Scripting Problem with cut command Post 302511053 by Dirk Einecke on Tuesday 5th of April 2011 04:19:04 PM
Old 04-05-2011
Problem with cut command

Hi!

I get a md5 hash of a file with this command:
Code:
openssl md5 /Users/me/MyLogo.png | cut -f 2 -d ' '

"cut" because I just want the hash. But there is a problem -> that doen't work with a path with spaces:
Code:
openssl md5 /Users/me/MyLogo 2.png | cut -f 2 -d ' '

The result is "2.png)=" ... because of the space in the file name and the space is my delimiter.

How can I solve this problem? Any ideas?

Dirk
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Cut command problem !

Hi all! Here is my problem : $ more file yougli:passwd:123456:3265:Yepa Yepo:/home/yougli:/bin/ksh As you can see, in the field "information", there are two spaces between "Yepa" and "yepo". My problem is : $ PARAM='more file | cut -d":" -f5' $ echo $PARAM Yepa Yepo Now i only... (2 Replies)
Discussion started by: tomapam
2 Replies

2. Shell Programming and Scripting

Problem with UNIX cut command

#!/usr/bin/bash cat /etc/passwd | while read A do USER=`echo “$A” | cut -f 1 -d “:”` echo “Found $USER” done This shell script should make USER = the first field of the first line of the file /etc/passwd Eg: adm daemon bob jane kev etc ... However USER=echo... (3 Replies)
Discussion started by: kevin80
3 Replies

3. UNIX for Dummies Questions & Answers

facing problem with cut command

hi , i used ls -ltr | cut -f 1 > \dev\tty but all teh coulmns r getting printed instead of only one........how can i resolve this? prob 2 : wud be able start cutting from last field......supposing in the case of dyanmic list.i dunno the field number of last column.......so is... (3 Replies)
Discussion started by: vivekshankar
3 Replies

4. Shell Programming and Scripting

Problem with cut command

I am trying to take one part of my text from file and save it to variable $x I tryed this... x=`cut -c 6-9 $fajl` my file looks like this fajl: 21890001277 89386911 23638FBCDC 28EE01A1 0000 26855 124 244326 21890001277 89766911 23638FBCDC 28E021A1 0000 26557 134 684326 21890001277... (7 Replies)
Discussion started by: amon
7 Replies

5. Shell Programming and Scripting

problem developing for or while loops with the cut command

I have been working on a script all day and am having very little success. Essentially, I am reading a file and trying to format the data in the file. I am currently trying to put the data into three separate files, so that I can paste them back together into a single output file. Trying to... (16 Replies)
Discussion started by: synergy_texas
16 Replies

6. Shell Programming and Scripting

Problem using cut command in shell script

I'm new to shell programming, and am having a problem in a (Korn) shell program, which boils down to this: The program reads a record from an input file and then uses a series of "cut" commands to break the record into parts and assign the parts to variables. There are no delimiters in the... (2 Replies)
Discussion started by: joroca
2 Replies

7. Shell Programming and Scripting

CUT command problem

Hi I have a strange problem when using cut command when i am using the below command, it is working fine,I am getting the data in new file xyz.dat cut -c 1-75 abc.dat > xyz.dat when i am using the below command, I am getting the data in new file abc.dat , but empty file cut -c 1-75... (4 Replies)
Discussion started by: vaas
4 Replies

8. Shell Programming and Scripting

Problem in using cut command

Hi Friend , i have one file say xyz.lst and it has content like dn: cn=m.hariharan,cn=employee,cn=delhi circle,cn=users,dc=industowers,dc=c dn: cn=ajay.jain,cn=employee,cn=gujarat circle,cn=users,dc=industowers,dc=com dn: cn=ajitkumar.thakor,cn=employee,cn=gujarat... (4 Replies)
Discussion started by: harish anand
4 Replies

9. Shell Programming and Scripting

Problem in using cut command with pipe as a delimiter while using in a script

There is a text file in my project named as "mom.txt" in which i want to have contents like.................. LSCRM(Application Name): 1: This is my first application. 2: Today we did shell scripting automation for this app. 3: It was really a good fun in doing so. 4: Really good.| (Here i... (7 Replies)
Discussion started by: Abhijeet Anand
7 Replies

10. Shell Programming and Scripting

Problem in extracting data using cut/awk command

Hi Everyone, I have a very simple problem and i am stuck in that from last 8 days. I tried many attempts, googled my query but all in vain. I have a text file named "test.txt" In that suppose i have contents like: Java: 1 Object oriented programming language 2 Concepts of Abstraction... (5 Replies)
Discussion started by: Abhijeet Anand
5 Replies
md5(3)								      OpenSSL								    md5(3)

NAME
MD2, MD4, MD5, MD2_Init, MD2_Update, MD2_Final, MD4_Init, MD4_Update, MD4_Final, MD5_Init, MD5_Update, MD5_Final - MD2, MD4, and MD5 hash functions SYNOPSIS
#include <openssl/md2.h> unsigned char *MD2(const unsigned char *d, unsigned long n, unsigned char *md); void MD2_Init(MD2_CTX *c); void MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len); void MD2_Final(unsigned char *md, MD2_CTX *c); #include <openssl/md4.h> unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md); void MD4_Init(MD4_CTX *c); void MD4_Update(MD4_CTX *c, const void *data, unsigned long len); void MD4_Final(unsigned char *md, MD4_CTX *c); #include <openssl/md5.h> unsigned char *MD5(const unsigned char *d, unsigned long n, unsigned char *md); void MD5_Init(MD5_CTX *c); void MD5_Update(MD5_CTX *c, const void *data, unsigned long len); void MD5_Final(unsigned char *md, MD5_CTX *c); DESCRIPTION
MD2, MD4, and MD5 are cryptographic hash functions with a 128 bit output. MD2(), MD4(), and MD5() compute the MD2, MD4, and MD5 message digest of the n bytes at d and place it in md (which must have space for MD2_DIGEST_LENGTH == MD4_DIGEST_LENGTH == MD5_DIGEST_LENGTH == 16 bytes of output). If md is NULL, the digest is placed in a static array. The following functions may be used if the message is not completely stored in memory: MD2_Init() initializes a MD2_CTX structure. MD2_Update() can be called repeatedly with chunks of the message to be hashed (len bytes at data). MD2_Final() places the message digest in md, which must have space for MD2_DIGEST_LENGTH == 16 bytes of output, and erases the MD2_CTX. MD4_Init(), MD4_Update(), MD4_Final(), MD5_Init(), MD5_Update(), and MD5_Final() are analogous using an MD4_CTX and MD5_CTX structure. Applications should use the higher level functions EVP_DigestInit(3) etc. instead of calling the hash functions directly. NOTE
MD2, MD4, and MD5 are recommended only for compatibility with existing applications. In new applications, SHA-1 or RIPEMD-160 should be preferred. RETURN VALUES
MD2(), MD4(), and MD5() return pointers to the hash value. MD2_Init(), MD2_Update(), MD2_Final(), MD4_Init(), MD4_Update(), MD4_Final(), MD5_Init(), MD5_Update(), and MD5_Final() do not return val- ues. CONFORMING TO
RFC 1319, RFC 1320, RFC 1321 SEE ALSO
sha(3), ripemd(3), EVP_DigestInit(3) HISTORY
MD2(), MD2_Init(), MD2_Update() MD2_Final(), MD5(), MD5_Init(), MD5_Update() and MD5_Final() are available in all versions of SSLeay and OpenSSL. MD4(), MD4_Init(), and MD4_Update() are available in OpenSSL 0.9.6 and above. 0.9.7a 2000-08-14 md5(3)
All times are GMT -4. The time now is 10:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy