Sponsored Content
Full Discussion: removing spaces in filenames
Top Forums Shell Programming and Scripting removing spaces in filenames Post 302469156 by michaelrozar17 on Thursday 4th of November 2010 10:38:43 PM
Old 11-04-2010
Could use -print0 instead of -print. This helps to print file name that contain spaces in between. If pipping the -print0 output to some other command below is the general syntax.
Code:
find . -print0 | xargs -0 COMMAND

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

spaces in filenames

I have a problem with the script below #!/bin/sh for vo in `find -maxdepth 1 -type f -regex "^\./*$"` do ls -l "$vo" some other commands done It works fine until `find ...` returns files with spaces. I've tryed to change IFS but haven't succeed Any solutions? (4 Replies)
Discussion started by: Hitori
4 Replies

2. Shell Programming and Scripting

how to handle spaces in filenames

I'm trying to do something like that: for $filename in `ls -1` do some_command $filename done but it doesn't work properly for file names with spaces, for...in splits at spaces. Anyway around? (4 Replies)
Discussion started by: rayne
4 Replies

3. Shell Programming and Scripting

spaces in filenames, for do

Hi All, I see similar problems in past threads but so far no answers have worked for me. I am trying to write a script which parses a txt file that contains one filename per line, then finds those files on the local disk and copies them to a specified directory. What I have: ... (4 Replies)
Discussion started by: naviztirf
4 Replies

4. Shell Programming and Scripting

spaces in filenames

Hi I hope someone will be able to resolve this little teaser! I am running a script for file in `ls directory` do echo "$file" ...other code here.... done this works fine unless we receive a file with a name which has a space in it ie "filena me" (I know its not good... (8 Replies)
Discussion started by: Bab00shka
8 Replies

5. Shell Programming and Scripting

Looping through filenames with spaces

I need to loop through the files in a directory and process the files. But some of the filenames contain spaces. Here is a little test script I've been using to experiment. (I'm not really going to call 'echo', I'm doing some other processing.) Everything I try fails. How can I do this??... (7 Replies)
Discussion started by: KenJackson
7 Replies

6. Shell Programming and Scripting

Moving filenames containing spaces

I want to ftp all the sh files in the directory. Also if any of the file name contains spaces in them, it should be converted to underscores before it is ftped. I wrote the following code below: FILESSH=$(ls /mysh/*.sh) --- FILESH being used here for some other task --- echo "$FILESSH" |... (3 Replies)
Discussion started by: amicon007
3 Replies

7. Shell Programming and Scripting

Removing blank spaces, tab spaces from file

Hello All, I am trying to remove all tabspaces and all blankspaces from my file using sed & awk, but not getting proper code. Please help me out. My file is like this (<b> means one blank space, <t> means one tab space)- $ cat file NARESH<b><b><b>KUMAR<t><t>PRADHAN... (3 Replies)
Discussion started by: NARESH1302
3 Replies

8. Shell Programming and Scripting

awk and spaces in filenames

Hey there, this is my first post and I'll try to explain my situation as best I can.Here is a sample of the input file: ADO Sample.h,v ADO Sample 2010-05-21 lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample ADO SampleDoc.h,v ADO SampleDoc 2010-05-21... (3 Replies)
Discussion started by: rodan90
3 Replies

9. UNIX for Dummies Questions & Answers

Reading filenames with spaces

Hello I've got a certain no. of files in a directory whose names I'm reading and redirecting into a temporary text file using the command below: ls -l | grep ^- | awk '{print $9}'However, whenever the file names contain spaces the above command considers only the part of the file name up to... (5 Replies)
Discussion started by: S. BASU
5 Replies

10. Shell Programming and Scripting

Handling filenames with spaces

I'm trying to handle some files with spaces in their name using "" or \ . Like "file 1" or file\ 1. My current confusion can be expressed by the following shell script: #!/bin/bash touch "file 1" "file 2" echo -n "ls: " ; ls echo --- for file in "file 1" "file 2" ; do echo $file... (9 Replies)
Discussion started by: Ralph
9 Replies
NMBSTATUS(1)						User Contributed Perl Documentation					      NMBSTATUS(1)

NAME
nmbstatus - Lists NMB node status of a UDP network SYNOPSIS
nmbstatus [options] Options: --workgroup --pdc --bdc --lmb --dmb --members --quiet --allworkgroups --winsserver --print0 --debug --help --man GENERAL OPTIONS
--help Print a brief help message and exits.Prints a help message. --man Print the manual page and exit. --print0 Use '' instead of a tab stop as seperator between the output. --debug Use an debuglevel. No debuglevel available yet. GENERAL ARGUMENTS
--workgroup Perform all actions on this workgroup name. If no workgroup is set the information off all available groups is shown. --pdc If not called in conjunction with --quiet print a line starting with the acronym PDC followed by the seperator and the netbios name of the PDC if one is available. If not print nothing and return with 1. --bdc If not called in conjunction with --quiet print a line starting with the acronym BDC followed by the seperator and the netbios name of the BDC if one is available. If not print nothing and return with 1. --dmb If not called in conjunction with --quiet print a line starting with the acronym DMB followed by the seperator and the netbios name of the DMB if one is available. If not print nothing and return with 1. --lmb If not called in conjunction with --quiet print a line starting with the acronym LMB followed by the seperator and the netbios name of the LMB if one is available. If not print nothing and return with 1. --members If not called in conjunction with --quiet print a line starting with the word MEMBERS followed by the seperator and the netbios names of the workgroup members. If not print nothing and return with 1. --quiet Don't print any information. Just return with 0 if a type - pdc, lmb, dmb, or members was found. Else return 1. --allworkgroups List all available workgroups. --winsserver Use this WINS server to gather the information. DESCRIPTION
nmbstatus will detect workgroups, PDCs, BDCs, DMBs, LMBs, and Members of workgroups in your network. If more than one type is specizied but only one result found, nmbstatus nevertheless returns 0. AUTHOR
Lars Mueller <lmuelle@suse.de> If you find any errors in the code please let me know. COPYRIGHT
Copyright (c) 2003-2004 SuSE Linux AG. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 339: You forgot a '=back' before '=head1' Around line 341: '=item' outside of any '=over' perl v5.12.1 2009-01-02 NMBSTATUS(1)
All times are GMT -4. The time now is 07:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy