04-17-2014
Why commands inside bash script lost effectiveness?
Hi,
I have a bash script to run many system commands on CentOS machine, but I am puzzled by some commands had no effect on parent environment.
For example, I want to refresh the desktop xdg menu when some processes added or deleted items from desktop xdg menu. If I run "killall gnome-panel" directly to command line in a terminal, it'll refresh the gnome panel (killed the old panel, and restart the panel again) updated desktop xdg menu. But if I added "killall gnome-panel" to the bash script and run the script in the terminal, nothing did happen, it did not refresh the gnome-panel at all, just like it was not called.
I think that might be sub process could not affect to parent environment, but I could not find a solution to fix it . Any advice would be much appreciated.
BTW, I don't think the "killall gnome-panel" is an appropriate command to be used for refreshing or updating desktop xdg menu, appreciate if anyone know better commands to refresh or update the xdg menu.
Thank you.
Kind regards.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I use AIX (ksh) and Linux (bash) servers. I'm trying to do scripts to will run in both ksh and bash, and most of the time it works. But this time I don't get it in bash (I'm more familar in ksh).
The goal of my script if to read a "config file" (like "ini" file), and make various report.... (2 Replies)
Discussion started by: estienne
2 Replies
2. Shell Programming and Scripting
Dears,
I'm new in shell scripting and i need your help, i would like to know how can i create a script to ftp to a certain unix/linux machine/server IP address and get a file for example without user intervention? How can i force the script to use a certain username and password to access this... (4 Replies)
Discussion started by: Dendany83
4 Replies
3. Shell Programming and Scripting
When my script deals with large input files like 22Gb or 18 GB the basic commands like sort or join fails when run from inside the shell scripts. Can there be any specific reason for this?
For e.g.
sort -u -t "," -k1,1 a.csv > a.csv.uniq"
sort -u -t "," -k1,1 b.csv > b.csv.uniq"
The... (3 Replies)
Discussion started by: esha
3 Replies
4. UNIX for Dummies Questions & Answers
Hello,
I'm trying to write a bash script that will query the current system time (OS X 10.6.6) and then convert the output from HH:MM:SS into time in seconds. The output of the system time command (systemsetup -gettime) is returned as:
Time: HH:MM:SS
so I wanted to use awk -F: to grab... (5 Replies)
Discussion started by: xaiu
5 Replies
5. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I have just gotten into writing bash scripts for a class, part of the assignment is to read and be able to tell... (4 Replies)
Discussion started by: Byrang
4 Replies
6. Shell Programming and Scripting
Hello
I'm trying to write simple script to delete archive logs for RMAN, unfortunately it's not working, I tried two way to do that:
#!/bin/ksh
echo "Start ....."
rman target=/ << EOF
RUN {
delete force noprompt archivelog until time 'sysdate-10';
}
EXIT;
EOF
echo "END ..."
echo... (6 Replies)
Discussion started by: samer.odeh
6 Replies
7. Shell Programming and Scripting
I am trying to execute expect command inside by small bash script to login into servers using key authentication method. My script is as follows:
#!/bin/bash
HOST=$1
/usr/bin/expect -c "
spawn ssh -i /root/.ssh/id_rsa root@$HOST
expect -exact "Enter... (3 Replies)
Discussion started by: John Wilson
3 Replies
8. Shell Programming and Scripting
i have some script with some paths inside it. The idea is to some files which is on desktop copy and move to another location. Problem is that inside script is similar to this:
cp test1.zip /root/help/
because I allways have another zip files, does it possible to have some input which ask me... (18 Replies)
Discussion started by: tomislav91
18 Replies
9. Shell Programming and Scripting
I want to run commands inside a bash script.
An example is
I want to pass the command in a string as regexp as an argument to the script, then run sed on the bash variable
sed.sh regexp
sed.sh "-i \"s/<p>//g\""
then call
sed "$regexp" $fl (3 Replies)
Discussion started by: Kangol
3 Replies
10. UNIX for Beginners Questions & Answers
In a Redhat Linux environment, I could run salt commands on the $ prompt but not inside my bash scripts.
It will say command not found and the $PATH variable is exactly the same outside and inside the script.
!#/usr/bin/bash
echo “running”¯
salt "*" cmd.run ‘ls'
exit
Output:-... (8 Replies)
Discussion started by: gurudewa
8 Replies
LEARN ABOUT DEBIAN
sshmenu
SSHMENU(1) General Commands Manual SSHMENU(1)
NAME
sshmenu - GNOME applet for connecting to hosts using SSH.
DESCRIPTION
The SSHMenu applet puts all your most frequently used SSH connections on a handy menu in your GNOME panel (see below for non-GNOME ver-
sions. Click on a host name to open a new gnome-terminal window with an ssh connection to the selected host. Set up SSH options (such as
port forwarding etc) and select a gnome terminal profile (for colour schemes, font sizes etc) using the preferences dialog.
Add the applet to a GNOME panel in the normal way: right click on the panel, select 'Add to Panel' and then select the SSH Menu Applet from
the list.
Configure the applet using the 'Preferences' option on the applet menu.
STANDALONE VERSIONS
The SSHMenu application uses the GTK GUI toolkit but is not dependent on the GNOME desktop environment. Two alternative wrapper scripts
are provided:
sshmenu-gnome - provides all the functionality of the SSHMenu applet but in a standalone application window that could (for example) be
swallowed into the panel of an alternative desktop environment.
sshmenu - provides similar functionality to sshmenu-gnome, but without any GNOME dependencies. Notably, xterm is used instead of gnome-
terminal.
The Hacker's Guide ( http://sshmenu.sourceforge.net/dev/hackers_guide.html ) describes a number of ways in which the SSHMenu can be further
customised.
OPTIONS
The applet is not invoked from the command-line however the standalone versions recognise the following options and can be extended to
recognise more:
-c FILE, --config-file FILE
read and write config information to FILE instead of the default $HOME/.sshmenu
-d NUM, --debug NUM
set debug level to NUM (default: 0)
-s NUM, --socket-window-id NUM
use the XEmbed protocol to embed the SSHMenu user interface in the window identified by NUM instead of creating a new, top-level
window,
-V, --version
output version information and exit
AUTHOR
sshmenu-applet was written by Grant McLean <grant@mclean.net.nz>
July 4, 2006 SSHMENU(1)