Ah, yes I see. Your assumptions are right. I do expect a long string to be returned from find, and I do need to extract characters from that long path and pass them to the ln command.
I'm using a bash shell on CentOS Linux.
I think that command is more like what I need. Find blablabla and create a symlink in this directory with a prefix of part of it's path.
The moderator put my desired results in "code," in the original post which made the post quite confusing. In my opinion.
Each folder needs the unique characters from it's path because each directory "blablabla" will have the exact same name.
I don't think the code suggested by nezabudka will work. I don't see it extracting characters :53:14 and piping them to ln.
Hopefully, I've cleared things up a bit.
Thanks in advance.
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT HPUX
dirname
basename(3C)basename(3C)NAME
basename(), dirname() - extract components of a path name
SYNOPSIS DESCRIPTION
takes the path name pointed to by path and returns a pointer to the final component of the path name, deleting any trailing '/' characters.
If the string consists entirely of '/' characters, returns a pointer to the string "/". If path is a null pointer or points to the empty
string, returns a pointer to the string ".".
takes the path name pointed to by path and returns a pointer to a string that is a path name of the parent directory of that file. If path
is a null pointer, points to the empty string, or does not contain a '/' character, then returns a pointer to the string ".".
RETURN VALUE
returns a pointer to the final component of path.
returns a pointer to a string that is the parent directory of path.
EXAMPLES
The following code fragment calls and
WARNINGS
and may overwrite path.
and in non-threaded applications currently use a static buffer in each function to hold the result string. Any subsequent calls to and may
overwrite the static buffer. At some release after HP-UX 11i Version 1, HP may use to allocate the buffers. Once allocated, those buffers
will be reused and their addresses will not change; however, if the fails, and would return "." and would be set to
AUTHOR
and were developed by HP.
SEE ALSO basename(1), thread_safety(5).
STANDARDS CONFORMANCE basename(3C)