03-16-2009
Re: testing targets os link file > ln -s
ls will show what the file is at the end of the symbolic link if you do:
$ ls -L ${FILENAME}
You could then capture the return code and respond accordingly:
RESULT=$?
if [ ${RESULT} -ne 0 ]; then
echo "We have a problem Houston, with ${FILENAME}."
fi
HTH
Tony Fuller
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can anyone say some ideas about using/creating link files (for ex., lrwxrwxrwx 1 bin bin 7 Jan 10 2001 bin -> usr/bin) in a shell script. (2 Replies)
Discussion started by: yuvasyntel
2 Replies
2. UNIX for Dummies Questions & Answers
Does any one now if you can change permissions on a linked file with out completely removing it and then relinking it? (2 Replies)
Discussion started by: moviestud80
2 Replies
3. UNIX for Dummies Questions & Answers
How do you identify the type of a link in the output of the ls -l command? (1 Reply)
Discussion started by: Tom Bombadil
1 Replies
4. Shell Programming and Scripting
I have a shell script which GETS a file, but I only want to run this script if $FILE exists on the remote host, don't know correct syntax.....please help
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
bin
get $FILE
rename export.prn export.prn.$TIMESTAMP
!cat... (0 Replies)
Discussion started by: walterja
0 Replies
5. Shell Programming and Scripting
if I have 1000 files, named file1, file2, ... ,file1000. for each one, I want to append a line, for example "this is the end of file#".
then, I want to link them all together.
how can I do that by using a simple script? (1 Reply)
Discussion started by: fredao
1 Replies
6. Solaris
I setup RSC on a 280R using the network connection. Unfortunately, I am unable to telnet to this card and I was wondering if there was a way to test the link from the rsc card. Here is my rsc configuration:
machine1:/tmp/rsc# /usr/platform/SUNW,Sun-Fire-280R/rsc/rscadm show
page_enabled="false"... (0 Replies)
Discussion started by: dangral
0 Replies
7. UNIX for Dummies Questions & Answers
Hi All
I need to parse the target
something like:
ifeq '$@' 'first'
echo 1 $@
endif
ifeq '$@' 'second'
echo 2 $@
endif
The thing is to be able compare the target string to any string and then do the commands
Thanks a lot
ziv (0 Replies)
Discussion started by: zivsegal
0 Replies
8. UNIX for Dummies Questions & Answers
**DUP post in Shell Programming and Scripting ***
Hello,
I'm still learning the ins and outs of how to combine multiple Unix commands together (specifically AIX), but I'm looking to do the following (only on local files):
1. Find all symbolic links that are not set up using absolute... (3 Replies)
Discussion started by: bdizenhouse
3 Replies
9. UNIX for Dummies Questions & Answers
I am trying to test arguments to see if they are files in any directory.
I have :
but it's not working (7 Replies)
Discussion started by: skooly5
7 Replies
10. Shell Programming and Scripting
First off, I know this is sort of a rehash of similar questions that have been asked in other closed threads, but I haven't been able to figure out how to apply the answers provided in those threads to my scenario and make it work.
I am working on a script in KSH on AIX 5.1 that will do a bulk... (1 Reply)
Discussion started by: derndingle
1 Replies
LINK(3) 1 LINK(3)
link - Create a hard link
SYNOPSIS
bool link (string $target, string $link)
DESCRIPTION
link(3) creates a hard link.
PARAMETERS
o $target
- Target of the link.
o $link
- The link name.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.0 | |
| | |
| | This function is now available on Windows plat- |
| | forms (Vista, Server 2008 or greater). |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
Creating a simple hard link
<?php
$target = 'source.ext'; // This is the file that already exists
$link = 'newfile.ext'; // This the filename that you want to link it to
link($target, $link);
?>
NOTES
Note
This function will not work on remote files as the file to be examined must be accessible via the server's filesystem.
Note
For Windows only: This function requires PHP to run in an elevated mode or with the UAC disabled.
SEE ALSO
symlink(3), readlink(3), linkinfo(3).
PHP Documentation Group LINK(3)