#!/bin/ksh
in_use=$(fuser -u /path/to/file/filename)
if [ ${#in_use} -gt 0 ] ; then
echo "file in use"
else
echo "file not in use"
fi
I have few objections with the above!
on the same node with two different sessions,
I ran the following
session I
>
Code:
while :
do
echo "a" > file1
done
session II
>
Code:
while :
do
fuser -u file1; echo $?
sleep 1
done
the output really alternates between being used -> not being used
from the man pages of fuser, fuser returns a non-zero return code if none of the specified files is
accessed or in case of a fatal error. If at least one access has been
found, fuser returns zero.
I am writing a script that periodically reads in data from a text file. The only issue is that, that text file is periodically updated (appended to) by another script. I am using perl in UNIX environment. How can I check if that text file is being accessed, so I can wait until it is no longer being... (6 Replies)
We have a third party tool in UNIX to kick off a 'file copy' job based on a file existance. If a specific file exists in an UNIX directory, another process should start copy the file into another system for further processing. The issue is, the copy job is starting as soon as the file exists in... (6 Replies)
Hi Everyone,
Can someone please show me how to create a script that will search a text file for changes.
For example below is a sample of how the text file would look like,
RLH rlh-1 ALIVE 20:06:05
RLH rlh-7 ALIVE 20:06:05
RLH rlh-3 ALIVE ... (7 Replies)
Hello,
I want to make a script which says if a text file is empty or not.
I tried two ways of making it, but I have problems with both of them.
Now I think that the better way is the ls -s solution (considering that an empty text file has a 0 weight, because "cat file.txt" fails when file is... (4 Replies)
HI all,
I want to script where all the server names will be in a text file like
server1
server2
server3 . and the script should take servernames from a text file and perform copy of files if the files are not present on those servers.after which it should take next servername till the end of... (0 Replies)
Hi,
I am writing an SH script where I need to open text editor from within the script and wait until the user closed or quit text editor. And then execute consecutive commands.
Here is a very simplified example:
gedit data.txt
# ---- wait until Text editor is exited
echo "Text Editor is... (1 Reply)
Hi All,
I am very new to this forum and beginner to shell scripting.
I need a shell script to:
Search for a text in XML file à if the same text appears twice in an XML file à output file name
Script should loop thru every xml file of a given folder.
Please help me writing this script.
... (1 Reply)
Guys,
I know that the below command will cut the 13th field from test.txt file
awk -F"|" '{print $13}' test.txt
The answer would be,
CA
CN
Ohio
If we see the 3 rd one, it has more than 2 characters. So i wanted to check this in if condition and i want to get the output if the 13th... (4 Replies)
Is it possible to replace a line of text within a file while it's closed with a single command or a script? Please show me an example or point me to a webpage that shows an example. The file has this line of text:
LoginGraceTime 100
I want to replace it with the following:
... (2 Replies)
Hi all,
Please somebody help me with this:
I want to check if the files listed in a text file, are found under a directory or not.
For example: the file is list_of_files.txt, which contains inside this rows:
# cat list_of_files
logs
errors
paths
debug
#
I want to check if these... (3 Replies)
Discussion started by: arrals_vl
3 Replies
LEARN ABOUT CENTOS
gnome-settings-daemon
GNOME-SETTINGS-DAE(1) User Commands GNOME-SETTINGS-DAE(1)NAME
gnome-settings-daemon - GNOME settings daemon
SYNOPSIS
gnome-settings-daemon [OPTION...]
DESCRIPTION
gnome-settings-daemon provides many session-wide services and functions that require a long-running process. Among the services implemented
by gnome-settings-daemon are an XSettings manager, which provides theming, font and other settings to GTK+ applications, and a clipboard
manager, which preserves clipboard contents when an application exits. Many user interface elements of gnome-shell and gnome-control-center
rely on gnome-settings-daemon for their functionality.
The internal architecture of gnome-settings-daemon consists of a number of plugins, which provide functionality such as printer
notifications, software update monitoring, background changing, etc. For debugging purposes, these plugins can be individually disabled by
changing the gsettings key org.gnome.settings-daemon.plugins.plugin-name.active, where plugin-name is the name of the plugin. To see a list
of all plugins, use the command
gsettings list-children org.gnome.settings-daemon.plugins
gnome-settings-daemon takes the name org.gnome.SettingsDaemon on the session bus to ensure that only one instance is running. Some plugins
export objects under this name to make their functionality available to other applications. The interfaces of these objects should
generally be considered private and unstable.
gnome-settings-daemon is a required component of the GNOME desktop, i.e. it is listed in the RequiredComponents field of
/usr/share/gnome-session/sessions/gnome.session. It is started in the initialization phase of the session, and gnome-session will restart
it if it crashes.
OPTIONS -h, --help
Prints a short help text and exits.
--debug
Enables debugging code.
--timed-exit
Exits after a timeout (30 seconds) for debugging.
FILES
/usr/share/gnome-session/sessions/gnome.session
GNOME session definition file where gnome-settings-daemon is listed as a required component.
/etc/xdg/autostart/gnome-settings-daemon.desktop
Autostart file for gnome-settings-daemon, where its autostart phase is set.
SEE ALSO gnome-shell(1), gnome-control-center(1), gnome-session(1)GNOME GNOME-SETTINGS-DAE(1)