![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to list filenames with spaces in shell script | hikrishn | Shell Programming and Scripting | 1 | 06-18-2008 05:33 PM |
| tsch script problem (dealing with sed) | csnewbie84 | Shell Programming and Scripting | 10 | 05-02-2007 11:51 PM |
| File names with spaces? Is it possible? | Eric_2005 | Shell Programming and Scripting | 5 | 11-15-2006 05:13 PM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 05:25 AM |
| Directory names that contain spaces and other suggestions? | Shakey21 | Shell Programming and Scripting | 5 | 01-09-2002 06:29 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Dealing with spaces in file names in a shell script
Hi,
What's the best way to find all files under a directory - including ones with space - in order to apply a command to each of them. For instance I want get a list of files under a directory and generate a checksum for each file. Here's the csh script: #!/bin/csh set files = `find $1 -name '*'` foreach file ($files) set checksum = `sum $file` # Ignore directories if($status == 0) then echo "$checksum $file" endif end The problem with this is that if there are spaces in files, it doesn't work. Unfortunately csh is the only scripting language I sort of know. Is there a better way to do this? Thank you in advance, Sam |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|