Sponsored Content
Top Forums UNIX for Dummies Questions & Answers BASH: Change alias to script to add a task Post 302488810 by SilversleevesX on Tuesday 18th of January 2011 01:02:51 PM
Old 01-18-2011
The alias works like this:
Code:
homeperm bigger-than-life-xhd.jpg http://www.wd.com/store/drives/excalibur-premium-26tb-portable-sata-hd.jpg

(just something off the top of my head)

You'll notice that the name I'm giving the file and it's source URL are on the same line as the alias. I'm positive that this is because aliases, by definition, often substitute one word for two, or are used in place of particular commands that are easily confused with others the same binary might employ. cUrl also has, on its man page, a curl -O command -- the original reason for creating this alias was that I couldn't remember which "o" did what.

Does this explain it adequately?

BZT

---------- Post updated at 14:02 ---------- Previous update was at 13:57 ----------

I know an alias invoking a function or script can be made to perform a simple task on a local file. I have another alias, ditto, that starts a script called mditto, the code of which looks like this:
Code:
	d=$(exiv2 -g Iptc.Application2.FixtureId -Pv $1 2>/dev/null)
	if [[ "d" != "" ]]; then
		exiv2 -M"set Iptc.Application2.ObjectName $d" -k $1
		echo -e "RUBBERSTAMP: $1; '$d' to ObjectName field"
		echo -e "Thank Irfan for me next time you see him!"
	else
		echo -ne "Ditto what? There's no Fixture ID data in $1."
		echo -ne "I'll pass on this one thanks."
	fi

"$1" is the variable (placeholder?) for the file to be worked on. If I had a "$1" with a value of
Quote:
bigger-than-life-xhd.jpg http://www.wd.com/store/drives/excalibur-premium-26tb-portable-sata-hd.jpg
...I suppose I could use 'cut' or a string builtin to break it into two variables at the space, give those values to cUrl, stat (for) the date on "bigger-than-life-xhd.jpg" and pass the mod date from that to Exiv2 to annotate the file.

Does it sound like I'm on the right track? I'll try some code in a short while, test it, and if I run into a wall I'll be back round to ask where I'm coming up short.

BZT
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Query regarding alias and setting bash as a default script

Hi All, I am setting bash as my working shell in my .profile file. So I have written a line : bash as the list line in my .profile I want to use alias as follows: alias me='who am i' When i log in, as expeced I enter the bash shell but alias doesn't work. Is it because the alias is defined... (1 Reply)
Discussion started by: VENC22
1 Replies

2. UNIX for Dummies Questions & Answers

Alias, function or script (bash) to "revert" cd command?

In all of my brief and superficial experience with Unix or Linux, the one curious and consistent thing has been that 'cd ./' (back up one directory level) has done absolutely nothing in any of them. Now I understand that, at least for bash, 'cd ./' appears to have been substituted by 'cd ..' Am... (1 Reply)
Discussion started by: SilversleevesX
1 Replies

3. Shell Programming and Scripting

Idea for an "informative" bash alias or script

I had the idea come into my head that it would be good to have a single command that gave file type, file size, last modification date, and owner/group information, like what one would see in a GUI "Properties" dialog, but all in a terminal window. In my opinion, these statistics about a file... (5 Replies)
Discussion started by: SilversleevesX
5 Replies

4. Shell Programming and Scripting

Unable to change environment variables in bash script

Hello! For the moment some settings in my .bashrc contain the password of my company's firewall, which is not a good idea. I would like to use the string "PASSWORD" set in .bashrc and a script that changes all appearances of "PASSWORD" in the environment variables by the actual password (which... (4 Replies)
Discussion started by: markolopa
4 Replies

5. Shell Programming and Scripting

How to run Cygwin bash from windows scheduled task?

Hmmm.... I love these forums because I always get great prompt responses and I want to ask a question about running bash on windows. Is that allowed? Now I know I can install cygwin cron and run bash that way. Can I run bash from windows schedule task? How? thanks siegfried (1 Reply)
Discussion started by: siegfried
1 Replies

6. Shell Programming and Scripting

How to do one line bash schedule task?

This seems to work: https://www.unix.com/shell-programming-scripting/179705-how-run-cygwin-bash-windows-scheduled-task.html However, I was hoping to avoid writing a 2 line bat files to invoke my cygwin scripts as a scheduled task (since I'm making lots scheduled tasks). I was hoping this would... (1 Reply)
Discussion started by: siegfried
1 Replies

7. Shell Programming and Scripting

Windows Task with Bash script

Hello I have a problem with use bash script in windows task. If I use script by cygwin it's working well. If I use it by Windows task I'm get error Error : ERROR 2 (HY000) at line 2: File '.\xxx.csv' not found (Errcode: 2) Code Line : load data local infile './xxx.csv' REPLACE into... (16 Replies)
Discussion started by: karp
16 Replies

8. Shell Programming and Scripting

Is it possible to change paths inside a bash script?

i have some script with some paths inside it. The idea is to some files which is on desktop copy and move to another location. Problem is that inside script is similar to this: cp test1.zip /root/help/ because I allways have another zip files, does it possible to have some input which ask me... (18 Replies)
Discussion started by: tomislav91
18 Replies

9. Shell Programming and Scripting

Change directory within a bash shell script

Hi, I have been trying to execute the below command by changing directory and then copying contents of one directory to another by doing some file name manipulations in between. However this isnt working since as soon as the statement completes it goes back to the original folder. Can someone... (5 Replies)
Discussion started by: HikingLife
5 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), tiffdiff(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 03:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy