Sponsored Content
Top Forums Shell Programming and Scripting Send mdfind output into script file Post 302804809 by waggs on Thursday 9th of May 2013 07:49:30 AM
Old 05-09-2013
Send mdfind output into script file

I'm using mdfind to list images according to their orentation, thus:-

Code:
mdfind  " kMDItemOrientation == 1" -onlyin "/Users/me/Documents/STUDY/AskForum"

which outputs
Code:
/Users/me/Documents/STUDY/AskForum/01 (5).jpg
/Users/me/Documents/STUDY/AskForum/01 (4).jpg
/Users/me/Documents/STUDY/AskForum/01 (2).jpg
/Users/me/Documents/STUDY/AskForum/01 (1).jpg

and this
Code:
mdfind  " kMDItemOrientation == 0" -onlyin "/Users/me/Documents/STUDY/AskForum"

which outputs
Code:
/Users/me/Documents/STUDY/AskForum/01 (3).jpg



What I want to do is write the mdfind output into a script file thus:-

Code:
mv "/Users/me/Documents/STUDY/AskForum/01 (6).jpg" Ori-1
mv "/Users/me/Documents/STUDY/AskForum/01 (5).jpg" Ori-1
mv "/Users/me/Documents/STUDY/AskForum/01 (4).jpg" Ori-1
mv "/Users/me/Documents/STUDY/AskForum/01 (2).jpg" Ori-1
mv "/Users/me/Documents/STUDY/AskForum/01 (1).jpg" Ori-1


mv "/Users/me/Documents/STUDY/AskForum/01 (3).jpg" Ori-0


Can I do this from a UNIX commandline in Terminal on Mac OS X 10.7.5


Ta

waggs
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Easiest way to send output to a debug file?

I have this in my script: DEBUG_DIR=/log/rotate_output DEBUGLOG=${DEBUG_DIR}/rotate.${TIMESTAMP} SERVER_FILE_LIST="\ wasint0206 /logs/squid_backup wasint0201 /logs/squid_backup" /usr/bin/echo "${SERVER_FILE_LIST}" | while read SERVER DIRECTORY do cd /log/squid_logs/${SERVER}... (2 Replies)
Discussion started by: LordJezo
2 Replies

2. Shell Programming and Scripting

capture output of file and send last string thereof to new file

Hello, If I run a program from within shell, the output is displayed in the command line terminal. Is there a way I can capture that output and choose only the very last string in it to send it to a new file? Thank you (6 Replies)
Discussion started by: Lorna
6 Replies

3. Shell Programming and Scripting

send an email of script output

Hi All, I'm trying to send some file which generated by script to my email. when I run the script I'm getting an email. Thats fine. But it seems to be all messed up like below Memory Status on ServerA: Mem: 3867444k total, 862680k used, 3004764k free, 54456k buffers!! CPU Status on ServerA:... (4 Replies)
Discussion started by: s_linux
4 Replies

4. Shell Programming and Scripting

rm output from mdfind

I am trying to delete all aliases from a specific location. so far i have: rm -f `mdfind -onlyin /Users/steve/Desktop/Test 'kMDItemKind=Alias' /` i thought this would delete all files that were Aliases using ItemKind, but it will not delete the files. However, doing just mdfind -onlyin... (0 Replies)
Discussion started by: slindgre
0 Replies

5. Shell Programming and Scripting

Read file, send to dig, no output

From the command line I am running the following command: for i in $(awk '{print ($1)}' src-dst|uniq); do dig -x "$i" +short; done src-dst has a list of IP addresses. When this script is running and I do a ps -ef | grep dig, I see the proper dig command with IP addresses being run, but the... (2 Replies)
Discussion started by: phish
2 Replies

6. Shell Programming and Scripting

How to write this script:- check output word and send a mail?

Hi Guys, I am not Good at scripting. I need to write a script such that if output of command shows the particular word in output then send mail to abc@compay.com -bash-3.2$ ps -ef | grep bpbkar root 6040 1 0 13:05:19 ? 0:00 bpbkar -r 2678400 -ru root -dt 47395 -to 0... (20 Replies)
Discussion started by: manalisharmabe
20 Replies

7. Shell Programming and Scripting

Compare 2 files the send output to a file

Hallo Friends, I would like to compare two files, then write the difference between the two into output file then find a pattern then search for that pattern. -bash-3.2$ cat BS_Orig_20141112.csv|head -20 BW0159574451211141638275086@196.35.130.5 BW02043750712111491637691@196.35.130.5... (2 Replies)
Discussion started by: kekanap
2 Replies

8. Shell Programming and Scripting

Send output of time command to file

I am measuring the time it takes for a wget command to complete. Right now my command is: time wget https://`ifconfig -a | grep '32.29.120' | cut -d: -f2 | cut -d' ' -f1`:8443/primary-rest/shop?brandId=test --header="name: test" --no-check-certificate -o SELF_TEST.log The output I get is ... (2 Replies)
Discussion started by: Junaid Subhani
2 Replies

9. Shell Programming and Scripting

A shell script to run a script which don't get terminated and send a pattern from the output by mail

Hi Guys, I am very new to shell script and I need your help here to write a script. Actually, I have a script abc.sh which don't get terminated itself. So I need to design a script to run this script, save the output to a file, search for a given string in the output and if it exists send those... (11 Replies)
Discussion started by: Sambit Sahu
11 Replies

10. Shell Programming and Scripting

Run a script before and after reboot automatically and send output to two locations.

Hello Team . I am working a health check script ( bash) to run on linux server ( RedHat) and requirements are 1. The o/p of script need to be send to two diff files . I am testing with tee command . But I am not successful yet , any recommendations if that is the right approach ? 2. The same... (2 Replies)
Discussion started by: Varja
2 Replies
JPEGICC(1)						      General Commands Manual							JPEGICC(1)

NAME
jpegicc - little cms ICC profile applier for JPEG. SYNOPSIS
jpegicc [options] input.jpg output.jpg DESCRIPTION
lcms is a standalone CMM engine, which deals with the color management. It implements a fast transformation between ICC profiles. jpegicc is little cms ICC profile applier for JPEG. OPTIONS
-b Black point compensation. -c <0,1,2,3> Precalculates transform. (0=Off, 1=Normal, 2=Hi-res, 3=LoRes) [defaults to 1] -g Marks out-of-gamut colors on softproof. -h <0,1,2> Show summary of options and examples. -i profile Input profile (defaults to sRGB). -m <0,1,2,3> SoftProof intent. -n Ignore embedded profile. -p profile Soft proof profile -o profile Output profile (defaults to sRGB). -q <0..100> Output JPEG quality. -t <0,1,2,3> Intent (0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute). -v Verbose. EXAMPLES
To color correct from scanner to sRGB: jpegicc -iscanner.icm in.jpg out.jpg To convert from monitor1 to monitor2: jpegicc -imon1.icm -omon2.icm in.jpg out.jpg To make a CMYK separation: jpegicc -oprinter.icm inrgb.jpg outcmyk.jpg To recover sRGB from a CMYK separation: jpegicc -iprinter.icm incmyk.jpg outrgb.jpg To convert from CIELab ITU/Fax JPEG to sRGB jpegicc -iitufax.icm in.jpg out.jpg NOTES
For suggestions, comments, bug reports etc. send mail to info@littlecms.com. SEE ALSO
tifficc(1), icc2ps(1), icclink(1), icctrans(1), wtpt(1) AUTHOR
This manual page was written by Shiju p. Nair <shiju.p@gmail.com>, for the Debian project. September 30, 2004 JPEGICC(1)
All times are GMT -4. The time now is 01:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy