Sponsored Content
Top Forums Shell Programming and Scripting Why commands inside bash script lost effectiveness? Post 302898030 by hce on Thursday 17th of April 2014 10:01:20 PM
Old 04-17-2014
Quote:
Originally Posted by Corona688
Are you actually just running these "from a script" or are you running these from some other, separate environment like a crontab or the like? If it's run from a shell not descended from your login, it won't have your login information.
You are right. The script was running from clicking a python wx button, the issue I've just figured out is there is another command needs be run before it as following script.

exec su -l ${user}
killall gnome-panel

The "exec su -l ${user}" refreshed the change of user access permission, but lets user to log into another environment where the following "killall gnome-panel" won't afffect to the current parent environment which called script.

$ update_user_id.sh

In update_user_id.sh:

exec su -l ${user}
killall gnome-panel


The question is really, whether it is possible to make the subsequent login and changes to affect to parent environment? Or there is no way to make it work?

Thank you.

Kind regards.

$ update_user_id.sh


In update_user_id.sh:


exec su -l ${user}
killall gnome-panel
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

bash and ksh: variable lost in loop in bash?

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

How to use ftp commands inside shell script? Help please

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

Unix commands failing inside the shell script

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

using awk inside bash script?

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

brand new user!.. Lost on BASH script writing

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

RMAN commands inside crontab shell script

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

Expect not working inside my Bash script

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

Is it possible to change paths inside a bash script?

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

Executing sed command inside a bash script

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

Saltstack commands inside bash scripts donā€™t work

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
gnome-panel-screenshot(1)					   User Commands					 gnome-panel-screenshot(1)

NAME
gnome-panel-screenshot - GNOME screenshot utility SYNOPSIS
gnome-panel-screenshot [--window] [--delay=int] DESCRIPTION
gnome-panel-screenshot is the command-line interface version of the gnome-panel screenshot option. The gnome-panel screenshot option cap- tures the complete screen without the delay option. The command-line option is more versatile; it allows you to capture the screen image of a window, as well as the complete screen. gnome-panel-screenshot also allows you to specify a delay before the screen or window is captured into file. If the --window option is used, you must move the mouse pointer to the window to be captured. The --delay option is always used with the --window option, to allow sufficient delay to set up the required screenshot. Once you have captured the window region, you are presented with a preview of the snapshot. You can then choose one of the following three options to handle the captured image: o Save screenshot to file o Save screenshot to desktop o Save screenshot to web page (save in ~/public html) OPTIONS
The following options are supported: --window Capture a screenshot of the window in which the mouse pointer is located. --delay=int Pause for int seconds before capturing the window or screen EXAMPLES
Example 1: Capturing the full screen example% gnome-panel-screenshot EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/gnome-panel-scrExecutable for GNOME screenshot utility ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-panel | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
Latest version of the GNOME Desktop User Guide for your platform. gnome-panel(1) NOTES
Written by Ghee Teo, Sun Microsystems Inc., 2003. SunOS 5.10 2 Oct 2003 gnome-panel-screenshot(1)
All times are GMT -4. The time now is 11:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy