Sponsored Content
Top Forums Shell Programming and Scripting Calling specific characters from a find variable Post 303029333 by Don Cragun on Thursday 24th of January 2019 11:00:20 PM
Old 01-25-2019
With what you have shown us there is little hope of us being able to help you.

You seem to be saying that you want to extract 14 characters starting in position 53 from the 11 character string "./blablabla". We have no idea whether you are expecting other characters to come from subdirectory names, or if you have wildcard characters in "blablabla" that you aren't showing us, or something else.

If you tell us what operating system you're using, what shell you're using, show us some actual samples of the pathnames being produced by the command find . -name blablabla (in CODE tags), and show us exactly what ln commands you hope to produce from those pathnames (in CODE tags); we would have a much better chance of coming up with something that might accomplish what you're trying to do. Note that an ln -s command needs two operands; not just one (and your sample code seems to be trying to only produce one).

Please help us help you.
This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

calling a aliased variable

Issue: i have variable A which is an alias for variable B which is equal to "THIS IS A TEST" when every i echo variable A i only get the alias name for variable B, NOT the contents of variable B. HOSTNAME# echo $TESTIT + echo THIS IS A TEST THIS IS A TEST HOSTNAME# ls -l total... (10 Replies)
Discussion started by: Optimus_P
10 Replies

2. Shell Programming and Scripting

Find and replace a string a specific value in specific location in AIX

Hi, I have following samp.txt file in unix. samp.txt 01Roy2D3M000000 02Rad2D3M222222 . . . . 10Mik0A2M343443 Desired Output 01Roy2A3M000000 02Rad2A3M222222 . . (5 Replies)
Discussion started by: techmoris
5 Replies

3. Shell Programming and Scripting

sed replacing specific characters and control characters by escaping

sed -e "s// /g" old.txt > new.txt While I do know some control characters need to be escaped, can normal characters also be escaped and still work the same way? Basically I do not know all control characters that have a special meaning, for example, ?, ., % have a meaning and have to be escaped... (11 Replies)
Discussion started by: ijustneeda
11 Replies

4. Shell Programming and Scripting

Can't figure out how to find specific characters in specific columns

I am trying to find a specific set of characters in a long file. I only want to find the characters in column 265 for 4 bytes. Is there a search for that? I tried cut but couldn't get it to work. Ex. I want to find '9999' in column 265 for 4 bytes. If it is in there, I want it to print... (12 Replies)
Discussion started by: Drenhead
12 Replies

5. Shell Programming and Scripting

Count specific characters at specific column positions

Hi all, I need help. I have an input text file (input.txt) like this: 21 GTGCAACACCGTCTTGAGAGG 50 21 GACCGAGACAGAATGAAAATC 73 21 CGGGTCTGTAGTAGCAAACGC 108 21 CGAAAAATGAACCCCTTTATC 220 21 CGTGATCCTGTTGAAGGGTCG 259 Now I need to count A/T/G/C numbers at each character location in column... (2 Replies)
Discussion started by: thienxho
2 Replies

6. Shell Programming and Scripting

Calling a Variable based on a Variable

Hi all, I have a source config file with variables like so: eth1_ip=192.168.1.99 eth2_ip=192.168.1.123 eth3_ip=172.16.1.1 I am trying to run a script which loops based on the number of eth interfaces on a machine and therefore modifies the variable it calls in the environment based on the... (5 Replies)
Discussion started by: landossa
5 Replies

7. Shell Programming and Scripting

Regex in sed to find specific pattern and assign to variable

(5 Replies)
Discussion started by: radioactive9
5 Replies

8. Shell Programming and Scripting

Find and replace with 0 for characters in a specific position

Need command for position based replace: I need a command to replace with 0 for characters in the positions 11 to 20 to all the lines starts with 6 in a file. For example the file ABC.txt has: abcdefghijklmnopqrstuvwxyz 6abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz... (4 Replies)
Discussion started by: thangabalu
4 Replies

9. Shell Programming and Scripting

Calling a variable of variable from a file

Hi All, I have file which have looks like below abc=${def} def=${efg} efg= "this is the actual value" based on "abc" value I have to call "efg" value , Am using below lines but it is not working #!/bin/bash source file.txt echo $abc Please wrap all code, files, input &... (5 Replies)
Discussion started by: Prashanth.K
5 Replies

10. UNIX for Beginners Questions & Answers

Find records with specific characters in 2 nd field

Hi , I have a requirement to read a file ( 5 fields , ~ delimited) and find the records which contain anything other than Alphabets, Numbers , comma ,space and dot . ie a-z and A-Z and 0-9 and . and " " and , in 2nd field. Once I do that i would want the result to have field1|<flag> flag can... (2 Replies)
Discussion started by: ashwin3086
2 Replies
exif(1) 						 command line front-end to libexif						   exif(1)

NAME
exif - shows EXIF information in JPEG files SYNOPSIS
exif [ OPTION ] [ file... ] DESCRIPTION
exif is a small command-line utility to show and change EXIF information in JPEG files. Most digital cameras produce EXIF files, which are JPEG files with extra tags that contain information about the image. The exif command- line utility allows you to read EXIF information from and write EXIF information to those files. exif internally uses the libexif library. Each input file given on the command line is acted upon in turn, using all the options given. Execution will be aborted immediately if one file is not readable or does not contain EXIF tags. As EXIF tags are read, any unknown ones are discarded and known ones are automatically converted into the correct format, if they aren't already. Corrupted MakerNote tags are also removed, but no format changes are made. OPTIONS
-v, --version Display the exif version number. -i, --ids Show ID numbers instead of tag names. -t, --tag=TAG Select only this TAG. TAG is the tag title, the short tag name, or the tag number (hexadecimal numbers are prefixed with 0x), from the IFD specified with --ifd. The tag title is dependent on the current locale, whereas name and number are locale-independent. --ifd=IFD Select a tag or tags from this IFD. Valid IFDs are "0", "1", "EXIF", "GPS", and "Interoperability". Defaults to "0". -l, --list-tags List all known EXIF tags and IFDs. A JPEG image must be provided, and those tags which appear in the file are shown with an aster- isk in the corresponding position in the list. -|, --show-mnote Show the contents of the MakerNote tag. The contents of this tag are nonstandard (and often undocumented) and may therefore not be recognized, or if they are recognized they may not necessarily be interpreted correctly. --remove Remove the tag or (if no tag is specified) the entire IFD. -s, --show-description Show description of tag. The --tag option must also be given. -e, --extract-thumbnail Extract the thumbnail, writing the thumbnail image to the file specified with --output. -r, --remove-thumbnail Remove the thumbnail from the image, writing the new image to the file specified with --output. -n, --insert-thumbnail=FILE Insert FILE as thumbnail. No attempt is made to ensure that the contents of FILE are in a valid thumbnail format. --no-fixup Do not attempt to fix EXIF specification violations when reading tags. When used in conjunction with --create-exif, this option inhibits the creation of the mandatory tags. exif will otherwise remove illegal or unknown tags, add some mandatory tags using default values, and change the data type of tags to match that required by the specification. -o, --output=FILE Write output image to FILE. If this option is not given and an image file must be written, the name used is the same as the input file with the suffix ".modified.jpeg". --set-value=VALUE Set the data for the tag specified with --tag and --ifd to VALUE. Compound values consisting of multiple components are separated with spaces. -c, --create-exif Create EXIF data if it does not exist. Mandatory tags are created with default values unless the --no-fixup option is given. This option can be used instead of specifying an input file name in most cases, to operate on the default values of the mandatory set of EXIF tags. In this case, the --output option has no effect and no file is written. -m, --machine-readable Produce output in a machine-readable (tab-delimited) format. The --xml-output and --machine-readable options are mutually exclu- sive. -w, --width=N Set the maximum width of the output to N characters (default 80). This does not apply to some output formats (e.g. XML). -x, --xml-output Produce output in an XML format (when possible). The --xml-output and --machine-readable options are mutually exclusive. -d, --debug Show debugging messages. Also, when processing a file that contains corrupted data, this option causes exif to attempt to continue processing. Normally, corrupted data causes an abort. Help options -?, --help Show help message. --usage Display brief usage message. EXAMPLES
Display all recognized EXIF tags in an image and the tag contents, with bad tags fixed: exif image.jpg Display a table listing all known EXIF tags and whether each one exists in the given image: exif --list-tags --no-fixup image.jpg Display details on all XResolution tags found in the given image: exif --tag=XResolution --no-fixup image.jpg Extract the thumbnail into the file thumbnail.jpg: exif --extract-thumbnail --output=thumbnail.jpg image.jpg Display a list of the numeric values of only the EXIF tags in the thumbnail IFD (IFD 1) and the tag values: exif --ids --ifd=1 --no-fixup image.jpg Display the meaning of tag 0x9209 in the "EXIF" IFD according to the EXIF specification: exif --show-description --ifd=EXIF --tag=0x9209 Add an Orientation tag with value "bottom - left" to an existing image: exif --output=new.jpg --ifd=0 --tag=0x0112 --set-value=4 --no-fixup image.jpg Add a YCbCr Sub-Sampling tag with value 2,1 (a.k.a YCbCr 4:2:2) to an existing image and fix the existing tags, if necessary: exif --output=new.jpg --tag=YCbCrSubSampling --ifd=0 --set-value='2 1' image.jpg List table with all known EXIF tags, highlighting mandatory ones: exif -cl AUTHOR
exif was written by Lutz Mueller <lutz@users.sourceforge.net> and numerous contributors. This man page is Copyright (C) 2002-2010 Thomas Pircher, Dan Fandrich and others. SEE ALSO
http://www.sourceforge.net/projects/libexif exif 0.6.20 2010-12-14 exif(1)
All times are GMT -4. The time now is 02:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy