Sponsored Content
Top Forums Shell Programming and Scripting Dealing with spaces in file names in a shell script Post 302224194 by same1290 on Tuesday 12th of August 2008 12:22:23 PM
Old 08-12-2008
I do have GNU tools and that worked very well. Thanks.

I was wondering if there's a way to print out just the checksums and not the pathnames. I have a huge number of files - and I want to keep the size of the checksum report to a minimum.

Thanks again,
Sam
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File names with spaces? Is it possible?

Gurus - I got one simple TXT file with long file name with blank spaces in between the words. I am trying to display that full file name, but it breaks while displaying. Could somebody shed some light here? Script ------ for i in `cat ~\temp\employee.txt` do echo $i done (5 Replies)
Discussion started by: Eric_2005
5 Replies

2. Shell Programming and Scripting

want only file names (not whole path) in shell script

hi i wrote following script, #!/usr/bin/sh for index in `ls /tmp/common/*.txt` do echo "$index" done here index is giving full path but in my program i want only file names (not along with whole path) Eg. if in /tmp/common files are a.txt and b.txt den out should be a.txt b.txt ... (6 Replies)
Discussion started by: crackthehit007
6 Replies

3. Shell Programming and Scripting

Remove spaces between file names

Hi All, I have spaces in between file names. "Material Header.txt" "Customer Header.txt" "Vendor Header.txt" And how can I remove spaces between file names like below MaterialHeader.txt CustomerHeader.txt VendorHeader.txt Thanks Srimitta (10 Replies)
Discussion started by: srimitta
10 Replies

4. Shell Programming and Scripting

Dealing with files with spaces in the name

Hello, I'm a computer science major and I'm having problems dealing with file names with spaces in them. Particularly I'm saving a file name in a variable and then using the variable in a compare function i.e. a='te xt.txt' b='file2.txt' cmp $a $b If anyone could help me with this particular... (10 Replies)
Discussion started by: jakethegreycat
10 Replies

5. Shell Programming and Scripting

How to strip the spaces in file names?

please somebody tell me what is wrong with this, while the thumbnail grabbing works and encoding works, but what is not working is, mv $i.jpg /var/www/thumbs/ and mv $i.mp4 /var/www/uploads/ #!/bin/bash # MINT 9 - FFMPEG - QT-FASTSTART - X264 - MP4 DIR=/var/www/tmp for i in... (9 Replies)
Discussion started by: mysoogal
9 Replies

6. Shell Programming and Scripting

Dealing with white spaces in bash scripts

I'm trying to search for all files in directory with particular GID then change the GID to match the UID of each file: #!/bin/sh for i in $(find /dump -gid 200 | sed 's/\ /\\\ /g' | sed 's/\&/\\\&/g'); do chgrp $(ls -ln ${i} | awk '{print $3}') ${i} done I'm using sed to deal with... (7 Replies)
Discussion started by: venmx
7 Replies

7. UNIX for Advanced & Expert Users

Shell script for dealing with XLS file with multiple tabs/worksheets

Hey Guys , Recently working on a requirement , i had to deal with XLS file with multiple tabs and the requirement was as below : 1. Convert one XLS file with multiple tabs to multiple CSV files. -- As i was working on MAC , so it was quite easy through APPLESCRIPT to deal with this.But... (2 Replies)
Discussion started by: himanshu sood
2 Replies

8. Shell Programming and Scripting

Dealing with filename spaces in Perl

The following command to replace text in place in multiple files in a directory is tripping up on filename spaces (Windows environment). I really don't know Perl. find '\\server\directory' | xargs perl -pi -e 's/textA/textB/g'Mike (2 Replies)
Discussion started by: Michael Stora
2 Replies

9. UNIX for Advanced & Expert Users

Problem with shell script while spaces encountered in directory names

Hi, I am having issues with the jar -tf command when I put in the shell script. The command runs fine from the command line as shown below. # jar -tf "./VirtualBox Dropped Files/2016-04-17T20:58:49.129139000Z/hive-exec-0.8.1.jar" But when I put in a shell script(shown below) and the... (10 Replies)
Discussion started by: vinoo128
10 Replies

10. SCO

Long file names within shell script

I am downloading a zip file that contain files that are very long. I am trying to process them, but cannot. I can move the files from one directory to another at the shell prompt, but not within a shell script, I get a stat error. The files look somewhat like this; ... (5 Replies)
Discussion started by: trolley
5 Replies
Dpkg::Checksums(3)						   libdpkg-perl 						Dpkg::Checksums(3)

NAME
Dpkg::Checksums - generate and manipulate file checksums DESCRIPTION
This module provides an object that can generate and manipulate various file checksums as well as some methods to query information about supported checksums. EXPORTED FUNCTIONS
@list = checksums_get_list() Returns the list of supported checksums algorithms. $bool = checksums_is_supported($alg) Returns a boolean indicating whether the given checksum algorithm is supported. The checksum algorithm is case-insensitive. $value = checksums_get_property($alg, $property) Returns the requested property of the checksum algorithm. Returns undef if either the property or the checksum algorithm doesn't exist. Valid properties currently include "program" (returns an array reference with a program name and parameters required to compute the checksum of the filename given as last parameter) and "regex" for the regular expression describing the common string representation of the checksum (as output by the program that generates it). OBJECT METHODS
my $ck = Dpkg::Checksums->new() Create a new Dpkg::Checksums object. This object is able to store the checksums of several files to later export them or verify them. $ck->reset() Forget about all checksums stored. The object is again in the same state as if it was newly created. $ck->add_from_file($filename, %opts) Add checksums information for the file $filename. The file must exists for the call to succeed. If you don't want the given filename to appear when you later export the checksums you might want to set the "key" option with the public name that you want to use. Also if you don't want to generate all the checksums, you can pass an array reference of the wanted checksums in the "checksums" option. It the object already contains checksums information associated the filename (or key), it will error out if the newly computed information does not match what's stored. $ck->add_from_string($alg, $value) Add checksums of type $alg that are stored in the $value variable. $value can be multi-lines, each line should be a space separated list of checksum, file size and filename. Leading or trailing spaces are not allowed. It the object already contains checksums information associated to the filenames, it will error out if the newly read information does not match what's stored. $ck->add_from_control($control, %opts) Read checksums from Checksums-* fields stored in the Dpkg::Control object $control. It uses $self->add_from_string() on the field values to do the actual work. If the option "use_files_for_md5" evaluates to true, then the "Files" field is used in place of the "Checksums-Md5" field. By default the option is false. @files = $ck->get_files() Return the list of files whose checksums are stored in the object. $bool = $ck->has_file($file) Return true if we have checksums for the given file. Returns false otherwise. $ck->remove_file($file) Remove all checksums of the given file. $checksum = $ck->get_checksum($file, $alg) Return the checksum of type $alg for the requested $file. This will not compute the checksum but only return the checksum stored in the object, if any. If $alg is not defined, it returns a reference to a hash: keys are the checksum algorithms and values are the checksums themselves. The hash returned must not be modified, it's internal to the object. $size = $ck->get_size($file) Return the size of the requested file if it's available in the object. $ck->export_to_string($alg, %opts) Return a multi-line string containing the checksums of type $alg. The string can be stored as-is in a Checksum-* field of a Dpkg::Control object. $ck->export_to_control($control, %opts) Export the checksums in the Checksums-* fields of the Dpkg::Control $control object. AUTHOR
Raphael Hertzog <hertzog@debian.org>. 1.16.15 2014-06-05 Dpkg::Checksums(3)
All times are GMT -4. The time now is 04:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy