Omgili - forum search, search forums  
  

Discussions about bash script

Displaying 1 - 10 out of 13,473 discussions.  
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
What is the difference between executing a bash script like A and sourcing a bash script like B? A >./myscript B >source myscript
Started by on , 5 posts by 5 people.  
Execution starts....
Sourcing is essentially the same as typing each line of the script in at the command prompt one at a time...
So if you have configs or function environment.
Sourcing you get all the extra variables defined in the script.
I have 1 bash script that runs another bash script, however the first bashscript isn't waiting for the second one to complete before proceeding, how can I force it to wait? For example: #!/bin/bash # first.sh #call to secondary script sh second.sh echo...
Started by on , 5 posts by 5 people.  
Check the ....
Are you sure that the other script isn't running problem with your script.
Make sureNormally it does; something else is happening.
Flag ( bash -x first.sh ) to see exactly what commands your script is executing.
I have a Cygwin bash script that I need to watch and terminate under certain conditions - specifically, after a certain file has been created. I'm having difficulty figuring out how exactly to terminate the script with the same level of completeness that...
Started by on , 4 posts by 4 people.  
The script doesn't work unmodified under Cygwin, so I rewrote it, and with a couple more options....
This script looks like it'll do the job: #!/bin/bash # Author: Sunil Alankar ## # recursive kill, albeit not without some minor caveats.
Ask your Facebook Friends
How can I determine the name of the bash script file inside the script itself? Like if my script is in file runme.sh, than how would I make it to display "You are running runme.sh" message without hardcodding that? Thanks,
Started by on , 11 posts by 11 people.  
Echo "You are running $0" You can use $0 to determine your script name (with full path) - to get the script name only you can trim that variable with basename $0 If the script name has spaces they state but there is a still ....
I need to change the server date by running a bash script called by php. When i invoke the bash script from shell it works, but if i call it via php then it doesn't work. The bash script is run as root. php script code: <?php $time = $_POST['input_...
Started by on , 4 posts by 4 people.  
If you run a script as root, it will run as the root user unless you use some commands to make running the PHP script from the command-line as root or through a web interface? When you access the PHP script via a web browser, that....
I'm trying to write a bash script (in Ubuntu) that will backup a directory using tar. How can I do a check in the script so that it can only be run as root (or with sudo)? For instance, if a user runs the script, it should say that this script must be...
Started by on , 5 posts by 5 people.  
What is your objective here, to inform the user that they should run the script as root to stop a user from copying the script, taking....
To pull the effective uid use this command: id -u If the result is ‘0’ then the script is either.
I'm writing a script in Bash to test some code. However, it seems silly to run the tests if compiling the code fails in the first place, in which case I'll just abort the tests. Is there a way I can do this without wrapping the entire script inside of...
Started by on , 3 posts by 3 people.  
Use set -e #!/bin/bash set -e /bin/command-that-fails /bin....
To check the return status of every single command, your script would look like this: #!/bin/bash # I'mTry this statement: exit 0 Replace 0 with appropriate error codes.
Hello I have just migrated to a UNIX workstation. My memory of Bash shell scripts has faded since school and I find the syntax to be highly confusing. I am wondering what other scripting languages are used to automate tasks. The two most popular ones ...
Started by on , 11 posts by 11 people.  
Beyond that, perl and python are popular these days; I'm different tasks: Bash....
Just guessing though, dunno if anyone has done from scratch, it's probably best to (re-)learn bash.
That bash is most widely used, probably followed by perl.
How do I get the path of the directory in which a bash script is located FROM that bash script. For instance, lets say I want to use a bash script as a launcher for another application. I want to change working directory to the one where the bash script...
Started by on , 19 posts by 19 people.  
`pwd` (remember the backtics) will get you the current directory from within your bash script= This is linux specific....
And not where you run the script from: #!/bin/bash $orpath = 'set original path'; $path = `pwd`; if [ $path.
Okay, so I'm learning Bash, and there's that exercise; "Write a script that checks every ten seconds if the user 'user000' is logged in." My idea is to grep a who , but I don't know how to incorporate this into a script. I tried things like if [ `who ...
Started by on , 6 posts by 6 people.  
This uses $? - a Shell variable which stores the return... .
If [ "$?" -eq "0" ] then ...
Mine does not.
You can do who | grep "user000" > /dev/null 2>&1 # You can use "-q" option of grep instead of redirecting to /dev/null # if your grep support it .
Page: 1   2   3   4   5   6   7   8   9   10  

Related Message Boards & Forums

  • Stack Overflow
  • Server Fault
Related Searches
Bash script    script bash find    calcul dans script bash    ant script calling bash shell script    bash script all file in folder batch processing    converting bash-scripts into GUI's    cygwin bash script change directories    change directory not working in bash script    change directory in a bash script    bash shell script get parent directory   
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost