Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. jones33

    Variable scope after exporting

    Thanks Ghodmode, Earlier you mentioned that "If you wanted to have a variable that was set in a script available to you outside of the script, you would need to source it. There is a built-in source command available in the Bash shell, but most people just use its alias, which is just a dot...
  2. jones33

    Variable scope after exporting

    Thanks Ghodmode Okay I'm going to add another twist to this Imagine we have 3 config files: config1.sh contains "export VAR_NAME="Leo" config2.sh contains "export VAR_NAME="Pat" config3.sh contains "export VAR_NAME="Matt" Now if we have the script printName #!/bin/sh VAR_SCRIPT=$1 ...
  3. jones33

    Variable scope after exporting

    Thank you very much Ghodmode So when a variable is exported within a script is it only available to that script and all the scripts called from within that script?
  4. jones33

    Variable scope after exporting

    Hi, could somebody please advise me about the scope of variables in a bourne shell script in the following situation: If I have a script printName - just for simplicity #!/bin/sh VAR_NAME=$1 export $VAR_NAME while [ true ] do echo $VAR_NAME done Now if I run this 3 times concurrently...
  5. jones33

    Adding a lable name when running a script

    Hi, is it possible to specify a label name for a unix script when running it? Then when greping for the script afterwards one could just grep for the label name. I want to be able to uniquely identify different instances of the same script running and I was wondering if I could add a unique...
  6. jones33

    BCPing data into specific columns in a table

    Hi, I have a table with 15 columns. However, in my data file I only have 9 columns. I have created a format file to map the data fields to the relevant columns. Each time I BCP data into the table though it just inserts the data into the first 9 columns regardless of the fact that I have mapped...
  7. jones33

    Script creating new processes

    Hi, I would like to check if my understanding is correct of how a single script creates new processes. When the script starts initially it creates a new process. This is the parent process. Then as new processes are spawned within the script they will have a new PID but the PPID will be the...
  8. jones33

    1 Script, 2 processes each with a different status

    At the beginning of a script I am writing I am trying to identify if the script is already running and if it is then exit the script. At the moment I do a /usr/ucb/ps auxwww and exclude the current process id of the script and look for every other process with the script name. This doesn't work...
  9. jones33

    1 Script, 2 processes each with a different status

    Hi, the reason I am using the /usr/ucb/ps auxwww version of ps is so that it will not truncate the name of the process returned. Is there any version of ps that I can use or any flag I can use with ps so that the name of the process will not be truncated and the PPID will also be returned...
  10. jones33

    1 Script, 2 processes each with a different status

    Thanks PHV, do you know if it is possible to return the parent process id with the command /usr/ucb/ps auxwww I know it's possible with ps -ef Just wondering about the other command. Many Thanks
  11. jones33

    1 Script, 2 processes each with a different status

    I came across this, which is what I think you were saying PHV When you give a command to the Shell, it will fork a process to execute the command. While the child process is executing the command, the parent will go to sleep. Sleeping means that the process will not use any CPU time. It remains...
  12. jones33

    1 Script, 2 processes each with a different status

    Thanks PHV, but isn't `` just used to evaluate an expression? What should I be using instead to prevent a new process being created? Many Thanks
  13. jones33

    1 Script, 2 processes each with a different status

    Hi PHV, The script which is causing the problem is launched from another script as follows: submitJob.sh ${JOB_PROFILE} $CONFIG_OVERRIDE_FILE STATUS=$? echo "submitJob.sh status: $STATUS" Nothing complicated here. Just a call to the script. The script submitJob.sh starts as follows...
  14. jones33

    1 Script, 2 processes each with a different status

    Hi, I have a Unix script which I start and then immediately after starting it I check to see if another process with the same script name but not the same current process id is running. What I noticed is that when I launch this script. Just by calling its name from another script there are 2...

Part and Inventory Search

Back
Top