10-23-2009
Directry create or not..
How to check whether a directry is created or not ?
10 More Discussions You Might Find Interesting
1. IP Networking
how to create a new a/c and use it for webhosting such as my domain is blah.com and i wanan host blah.com on that a/c :) (1 Reply)
Discussion started by: irwan
1 Replies
2. UNIX Desktop Questions & Answers
I am a bash shell programmer and I create programs on occasional basis.
Now, I dont want my programs to be run by typing out its name at a command line. I want to make it as user friendly as possible. I want to create icons on the desktop so users can click on it. mind you, I said "desktop... (7 Replies)
Discussion started by: TRUEST
7 Replies
3. Solaris
hello
sorry but i'm beginning with solaris (i use Aix)
How can I create a new filesystem with solaris 9 ? (and define the size ).
I find newfs and mkfs but i don't know how use it
Thank you (3 Replies)
Discussion started by: pascalbout
3 Replies
4. Shell Programming and Scripting
Hi Friends,
Following script will replace "prd123" to "tst123" for all the .csh file the directry.
for i in *.csh
echo '$i'
do
ex - ${i} <<EOF
%s/prd123/tst123/g
wq!
EOF
done
Like this can I make a script which will delete the last line of all .csh file
in the directry.
... (9 Replies)
Discussion started by: bikas_jena
9 Replies
5. Shell Programming and Scripting
i am creating a shell script to generate a file format. i want to register each and every activity in the log file.
here are the commands which i have given, Don't know why i am getting error.
v_log_loc="$APPLCSF/log"; export v_log_loc
v_logfile=${p_po_requestid}_LOG; export v_logfile
... (4 Replies)
Discussion started by: aindurkhya
4 Replies
6. Solaris
Hi,
I am new to solaris10. I want to add a user without prompting for any password, while logging to his machine
Can someone tell me how to do that???
Thiru (2 Replies)
Discussion started by: tirupathiraju_t
2 Replies
7. Shell Programming and Scripting
Hi,
First apologies for starting the old issue (already discussed in this forum).
How can I remove ^M characters from a directory which contains lot of subdirectory and files (this includes jar, war, .xml, .properties etc). Noticeable is that, all files might not contain ^M characters.
... (3 Replies)
Discussion started by: bhaskar_m
3 Replies
8. Homework & Coursework Questions
first off let me introduce myself. My name is Eric and I am new to linux, I am taking an advanced linux administration class and we are tasked with creating a script to add new users that anyone can run, has to check for the existence of a directory. if the directory does not exist then it has... (12 Replies)
Discussion started by: pbhound
12 Replies
9. AIX
Currently directory /home/apps/fs_1 on both servers A and B is mounted on /dev/hd1.
I am assuming it should have separate filesystem, with its own lv as fs_1_lv to which /home/apps/fs_1 should be mounted, am I correct ?
For Example:
Server A:
Filesystem GB blocks Free %Used Iused... (2 Replies)
Discussion started by: aix_admin_007
2 Replies
10. Shell Programming and Scripting
I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
Discussion started by: cmccabe
8 Replies
LEARN ABOUT MOJAVE
shlock
SHLOCK(1) BSD General Commands Manual SHLOCK(1)
NAME
shlock -- create or verify a lock file for shell scripts
SYNOPSIS
shlock [-du] [-p PID] -f lockfile
DESCRIPTION
The shlock command can create or verify a lock file on behalf of a shell or other script program. When it attempts to create a lock file, if
one already exists, shlock verifies that it is or is not valid. If valid, shlock will exit with a non-zero exit code. If invalid, shlock
will remove the lock file, and create a new one.
shlock uses the link(2) system call to make the final target lock file, which is an atomic operation (i.e. "dot locking", so named for this
mechanism's original use for locking system mailboxes). It puts the process ID ("PID") from the command line into the requested lock file.
shlock verifies that an extant lock file is still valid by using kill(2) with a zero signal to check for the existence of the process that
holds the lock.
The -d option causes shlock to be verbose about what it is doing.
The -f argument with lockfile is always required.
The -p option with PID is given when the program is to create a lock file; when absent, shlock will simply check for the validity of the lock
file.
The -u option causes shlock to read and write the PID as a binary pid_t, instead of as ASCII, to be compatible with the locks created by
UUCP.
EXIT STATUS
A zero exit code indicates a valid lock file.
EXAMPLES
BOURNE SHELL
#!/bin/sh
lckfile=/tmp/foo.lock
if shlock -f ${lckfile} -p $$
then
# do what required the lock
rm ${lckfile}
else
echo Lock ${lckfile} already held by `cat ${lckfile}`
fi
C SHELL
#!/bin/csh -f
set lckfile=/tmp/foo.lock
shlock -f ${lckfile} -p $$
if ($status == 0) then
# do what required the lock
rm ${lckfile}
else
echo Lock ${lckfile} already held by `cat ${lckfile}`
endif
The examples assume that the file system where the lock file is to be created is writable by the user, and has space available.
HISTORY
shlock was written for the first Network News Transfer Protocol (NNTP) software distribution, released in March 1986. The algorithm was sug-
gested by Peter Honeyman, from work he did on HoneyDanBer UUCP.
AUTHORS
Erik E. Fair <fair@clock.org>
BUGS
Does not work on NFS or other network file system on different systems because the disparate systems have disjoint PID spaces.
Cannot handle the case where a lock file was not deleted, the process that created it has exited, and the system has created a new process
with the same PID as in the dead lock file. The lock file will appear to be valid even though the process is unrelated to the one that cre-
ated the lock in the first place. Always remove your lock files after you're done.
BSD
June 29, 1997 BSD