|
Does anyone know of any resources that talk about best practices or design patterns for shell scripts (sh, bash etc...)?
Answer Snippets (Read the full thread at stackoverflow):
Other than that general principle....
shell script is a language designed always try to glue logic from existing utilities rather than recreating new logic in shell script.
You'll spot the Bash specific code soon enough.
Dash, etc.
|
|
Hello,
when I want to execute some shell script in Unix (and let's say that I am in the directory where the script is) , I just type:
./someShellScript.sh
and when I want to "source" it (e.g. run it in the current shell, NOT in a new shell) , I just type...
Started by Petike on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
When you run find, the shell will fork itself and then turn into the find process.
IFSbak
The problem lies in the way shell's work, and that '.' itself is not a command (neither is source in this).
|
|
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 Scott Davies on
, 11 posts
by 11 people.
Answer Snippets (Read the full thread at serverfault):
Sh (bourne shell re-use your scripts easily and means your knowledge is a good investment even if you change your , a replacement for the usnix shell....
On the web for learning it, not to mention code that you can copy and re-purpose .
|
Ask your Facebook Friends
|
Is there an open source or public domain framework that can document shell scripts similar to what JavaDoc produces? I don't need to limit this just to a specific flavor of shell script, ideally I would like a generic framework for documenting API or ...
Started by Mike on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
If you have Perl, here is an example of someone who used Perl's POD system for documentation of a shell script..
Can probably come up with a setup that will work for shell scripts with a bit of wrangling.
|
|
I was looking at http://tldp.org/LDP/abs/html/why-shell.html and was struck by:
When not to use shell scripts
...
Mission-critical applications upon which you are betting the future of the company Why not?
Started by Jon Ericson on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Also scripts are rather heavily coupled....
Who unit tests BASH scripts for example.
It is probably shell scripts that help take shell scripting.
You don't throw out the script wholesale.
Into a sub-program.
|
|
As part of an automated test, I have a python script that needs to call two shell scripts that start two different servers that need to interact after the calling script ends. (It's actually a jython script, but I'm not sure that matters at this point...
Started by ThomasGHenry on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Also, os.system.
Maybe doing something like shell=True
Python threads will all die with Python.
For you.
|
|
Has anyone seen, tried to implement, or otherwise played with TAP in shell? We're looking to create unit tests across many languages (don't get me started on why this doesn't exist so far), and since we have so much Perl code, we'll be looking at TAP ...
Started by Tanktalus on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Some things to keep in mind when" is mostly a set of shell functions (named test* ) and a runTests function which calls them one Producers for a list of libraries.
I usually write my own small test framework for my shell scripts.
|
|
Hi Folks,
Have people noticed that if you modify the source of a shell script, any instances that are currently running are liable to fail?
This in my opinion is very bad; it means that I have to make sure all instances of a script are stopped before ...
Started by YGA on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
#!/bin/sh....
If the full shell script is contained in a single source file, and that file is fully parsed before execution, then the shell script.
Depending on complexity of the shell scripts that are involved.
|
|
The only workaround I am aware of is using applescript in Spark/FastScripts with
do shell script "python script.py"
Answer Snippets (Read the full thread at superuser):
Other applications that launch AppleScripts like FastScripts for the execution of Shell scripts directly from within the application, but I dislike Quicksilver on the pointYou....
For an example that invokes some shell script.
|
|
What is the best practice when running external utilities in shell scripts. For example if I want to run 'gzip' in multiple scripts ensuring that a specific gzip binary is used should I make the full path to the binary a variable and just use the variable...
Started by Steve on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You can use conditionals to test.
I think the first option is the best $SOMEPATH/$EXEC_ONE --argument baz_file
in many system scripts.
To programs your script calls, and you probably don't want it visible.
|