11-02-2007
how to plug dummy data into zero byte file?
Hi,
How can I plug dummy data into files that are zero bytes ?
Here is a sample script for removing the files I think.
find /path/to/directory -size 0 -type f -exec rm -f {} \;
I am not sure how to change it to echo "dummy" > zerobyte.txt. Any suggestions?
Here's the farthest I got:
find /path/to/directory -size 0 -type f -exec echo "dummy" > whatisfilename.txt {} \;
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Please help me in removing the 2nd file :
-rw-rw-rw- 1 fup03a fup03a 9216 Aug 16 00:45 med_delay_log
-rw-rw-rw- 1 fup03a fup03a 0 Aug 16 18:04 (5 Replies)
Discussion started by: miltonkeynesguy
5 Replies
2. AIX
I run the command:
/usr/sbin/acct/fwtmp < /var/adm/wtmp > dummy.file
Get the login information
However, what's the meaning in the file:
abc pts/2 pts/2 7 2847322 0000 0000 1203261111 172.24.80.23 Sun Feb 17 10:11:51 EST 2007... (0 Replies)
Discussion started by: rainbow_bean
0 Replies
3. Shell Programming and Scripting
In my server migration requirement, I need to compare if one file on old server is exactly the same as the corresponding file on the new server.
For diff and comm, the inputs need to be sorted. But I do not want to disturb the content of the file and need to find byte-to-byte match.
Please... (4 Replies)
Discussion started by: krishmaths
4 Replies
4. UNIX for Dummies Questions & Answers
I have a file which contains 6 columns.
But I only need the first 3 columns. So I need to remove the last 3 columns. I checked 'cut' but it seems not working.
So is there a command that could remove certain columns from a file? :(
Thanks a lot!! (5 Replies)
Discussion started by: kaixinsjtu
5 Replies
5. Shell Programming and Scripting
Hi All
Can anyone please suggest me how to remove the last byte from a falt file .This is from the last line's last BYTE.
Please suggest me something.
Thank's and regards
Vinay (1 Reply)
Discussion started by: vinayrao
1 Replies
6. Shell Programming and Scripting
I am new to Unix so will really appreciate if someone can guide me on this.
What I want to do is:
Step1: Read binary file - pick first 2 bytes, convert from hex to decimal. Read the next 3 bytes as well.
2 bytes will specify the number of bytes 'n' that I want to read and write... (1 Reply)
Discussion started by: Kbenipel
1 Replies
7. UNIX for Dummies Questions & Answers
Hi, everyone,
I have a matrix, let's say:
1 2 3 4 5 6 ...
4 5 6 7 8 9 ...
7 8 9 1 2 3 ...
3 4 5 6 7 8 ...
.........
(nxm matrix)
Is there a simple command that can take certain specific rows out of the matrix?
e.g., I want to take row 2 (4 5 6 7 8 9 ...) and row 4 (3 4 5 6 7 8... (2 Replies)
Discussion started by: kaixinsjtu
2 Replies
8. Shell Programming and Scripting
Hey guys, i have a file a.txt and i need to insert a dummy data into it as per the below pattern..
bash: cat a.txt
1234,34
3434,45
4545,56
3434,56
Now i need the file in the below pattern
1234,34,a0001,C_01
3434,45,a0002,C_02
4545,56,a0003,C_03
3434,56,a0004,C_04
here the count of... (3 Replies)
Discussion started by: jaituteja
3 Replies
9. Shell Programming and Scripting
Hello. My latest project has me with the need for the following script. Basically, any directory that includes a .jpg file needs to also have a ".picture" file created (if it doesn't exist). Here's an example of what I need.
/mnt/user/Pictures/2011/Hawaii - 2011/.picture... (11 Replies)
Discussion started by: Davinator
11 Replies
10. Linux
hi,
i want to create a dummy file even if the path to that file is not exist as follows.
suppose, in my working directory 2 files are there. and
i create one more file which is exist as follows
# pwd
/home/satya
# ls
file1.txt file2.txt
# echo dummy > /home/satya/file3.txt
# ls... (3 Replies)
Discussion started by: snreddy_gopu
3 Replies
LEARN ABOUT MOJAVE
mdimport32
mdimport(1) BSD General Commands Manual mdimport(1)
NAME
mdimport, mdimport32 -- import file hierarchies into the metadata datastore.
SYNOPSIS
mdimport [-VXLArgn] [-d level | category] [-w delay] file | directory
mdimport32 [-VXLArgn] [-d level | category] [-w delay] file | directory
DESCRIPTION
mdimport is used to test Spotlight plug-ins, list the installed plug-ins and schema, and re-index files handled by a plug-in when a new plug-
in is installed.
mdimport32 is used in exactly the same way, but for 32 bit plugins.
The following options are available:
-g plugin Load the plugin at the provided path, ignoring system installed plugins. Useful for testing plugins that have not yet been
installed.
-V Print timing information for this run of mdimport.
-A Print out the list of all of the attributes and their localizations in the current language and exit.
-X Print the schema file and exit
-r Ask the server to reimport files for UTIs claimed by the listed plugin. For example, the following would cause all of the chat
files on the system to be reimported:
mdimport -r /System/Library/Spotlight/Chat.mdimporter
-p Print out performance information gathered during the run.
-L Print the list of installed importers and exit.
-d level Print debugging information. Level can be 1-4.
-n Don't actually set the attributes on the file. Useful for debugging.
-w msecs Wait for the specified interval between scanning files.
NOTES
The -f switch is obsolete in Leopard and beyond.
SEE ALSO
mdfind(1), mdutil(1), mdls(1)
Mac OS X Oct 27, 2004 Mac OS X