07-20-2011
Quote:
Originally Posted by
Scrutinizer
Hi, you need to use weak quoting around variable references:
mv "$line"
Hi, Scrutinizer:
While your quotes comment is certainly true, I believe there is also a more fundamental problem. The first nawk in the pipeline splits on any spaces, causing any filename with spaces to span multiple lines. By the time it reaches the end of the pipeline, there are no spaces to protect with quotes.
If indeed the source file is using spaces to delimit filenames which themselves may contain spaces, I suggest modifying the format of the source file.
If instead it is a tab-delimited file, the field separator has to be made more exact.
Regards,
Alister
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
For example,
/tmp/folder1
includes /tmp/folder1/a /tmp/folder1/b
/tmp/folder2
includes /tmp/c
Is there a command without removing files in /tmp/folder2 first to copy the /tmp/folder1 to /tmp/folder2?
and the result should be
/tmp/folder2 will include only /tmp/folder2/a... (2 Replies)
Discussion started by: lalelle
2 Replies
2. UNIX for Advanced & Expert Users
Hello all,
I'm trying to accomplish that if a file gets written to folder /path/to/a/ it gets automatically copied into /path/to/b/ the moment its get written.
I thought of writing a shell script and cron it that every X amount of minutes it copies these files over but this will not help me... (2 Replies)
Discussion started by: Bashar
2 Replies
3. Shell Programming and Scripting
Hi all,
*I use Uwin and Cygwin emulator.
I´m trying to search for all text files in the current folder (C/Files) and its sub folders using
find -depth -name "*.txt"
The above command worked for me, but now I would like to copy all found text files to a new folder (C/Files/Text) with ... (4 Replies)
Discussion started by: cgkmal
4 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I want to copy files from a unknown sub-folder to other sub-folder without copying the sub-folder. I tried the command:
find . -name Results*.pdf | cp *.* /home/dario/Desktop/
but i always copy the subfolder.
Can anybody help? (5 Replies)
Discussion started by: limadario
5 Replies
5. Shell Programming and Scripting
Ok question number two: I'd like to search a directory for multiple file types (rar, txt, deb) and depending on what's found, copy those files to folders named Rar, TextFiles, and Debs. I'm looking for speed here so the faster the script the better. I want it to be a function that I pass 1 argument... (4 Replies)
Discussion started by: DC Slick
4 Replies
6. Shell Programming and Scripting
Hello,
I have a small question and i hope someone can help me, if i have 200 domains directories in my server under this directory
something like
now how i can copy one folder i have to this directories?
Thank You (5 Replies)
Discussion started by: GamGom
5 Replies
7. UNIX for Dummies Questions & Answers
Hi ,
I have a file like this, i need to trace its path and copy the files from its path to one folder. I need to replace elib.com,melib.com to F:\.Here i need to copy to a folder called image. Please help
http://elib.com/SHC/NLNLHB/020001498.pdf ... (4 Replies)
Discussion started by: umapearl
4 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have a folder which contains some files like this.
bin.000001
bin.000002
bin.000003
bin.000004
bin.000005
bin.000129
bin.index
I want to copy all these files to a new folder except the last files.
Please provide some ideas.
Please use next time code tags for your code... (6 Replies)
Discussion started by: arijitsaha
6 Replies
9. Shell Programming and Scripting
Hello All
A similar question like this was asked before but I need to change part of the question.
I've two folders, Folder A contains some image files in 150 subfolders;
Folder B contains text files in 350 subfolders.
All image files in Folder A have the same filename as the text... (5 Replies)
Discussion started by: chlade
5 Replies
10. Shell Programming and Scripting
I want to move a folder with spaces from one folder to another.
I have two folders like this,
1).RT_032-222 -4444-01/ 2). RT_032-555 -7777-01/
I want to move files from 2 to 1 through shell script.Here I want to assign this like a user defined variable like as Source branch... (2 Replies)
Discussion started by: kannansoft1985
2 Replies
LEARN ABOUT MOJAVE
set_color
set_color(1) fish set_color(1)
NAME
set_color - set_color - set the terminal color
set_color - set the terminal color
Synopsis
set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR]
Description
Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple,
cyan, white and normal.
o -b, --background Set the background color
o -c, --print-colors Prints a list of all valid color names
o -h, --help Display help message and exit
o -o, --bold Set bold or extra bright mode
o -u, --underline Set underlined mode
o -v, --version Display version and exit
Calling set_color normal will set the terminal color to whatever is the default color of the terminal.
Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey
font color, while set_color --bold white will result in a white font color.
Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator.
set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and
incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of
ncurses and recompile fish against it in order to fix this issue.
Version 1.23.1 Sun Jan 8 2012 set_color(1)