What are the differences between shell languages like bash, zsh, fish and the scripting languages above that makes them more suitable for the shell?
When using the command line the shell languages seem to be much easier. It feels for me much smoother to use bash for example than to use the shell profile in ipython, despite reports to th...
Hi, I would like to excute a command in shell script.
This command will have a return code, 0 or non-0 if success or not.
If success, it will print something.
Now I need the printed stuff in shell script. How can I do that?
I know that I might redirect to a file and then read the file. Is there any way to redirect it to a variable...
I asked this question two months ago and got nary an answer. In fact I earned the tumbleweed badge for asking a question that garnered so little interest.
However, this seems like a straightforward question with a definitive answer and I really need to be able to do this.
If there's still no answers I'd sure appreciate if anyone has an...
Two questions: how can I write a shell variable from this script into its child script?
Are there any easier ways to do this?
If you can't follow what I'm doing, I'm:
1) starting with a list of directories whose names will be stored as values taken by $i
2) cd'ing to every value of $i and ls'ing its contents
3) echoing its contents ...
I have a program that returns something like this:
status: playing
artURL: http://beta.grooveshark.com/static/amazonart/m3510922.jpg
estimateDuration: 29400
calculatedDuration: 293000
albumName: This Is It
position: 7291.065759637188
artistName: Michael Jackson
trackNum: 13
vote: 0
albumID: 3510922
songName: Billie Jean
artistID: 39
son...
I have two servers, computer A and computer B, both running Linux. I need to write a program or a shell script which will continuously monitor the contents of my home directory on computer A and if anything changes, copy the changes to my home directory on computer B such that both home directories are always the same. (Any changes made ...
how can i easily (quick and dirty) change, say 10, random lines of a file with a simple shellscript?
i though about abusing ed and generating random commands and line ranges, but i'd like to know if there was a better way
...
Hello fellow computer people :)
I have a shell script that I will use as a watchdog timer. It checks to see if my other 'main' program is running. If it is not, it restarts it.
The question is: How do I get this installed on a Mac? Is there a folder/plist file scenario somewhere where the OS will automatically and periodically call the...
Hi all,
Having a regular size-efficient backup for only the modified checkedout elements in all views would be a great thing for us, since a great deal of the defined dynamic/snapshot views cannot be included in the daily backup policy.
The following ksh code is near to what we would need for a dynamic view, but it trivially assumes tha...
I want to substitute a certain filed of the text while keeping the same blank space:
For example, my text is:
Please help me with this problem
Any suggestion or help will be appreciated
Thanks to all who give help
And I want to replace the sentence
"Any ...
Can you please explain me, why despite of great ruby popularity for web applications thanks to rails framework it is still not used or very rarely used by linux users to create system apps/scripts. We can compare it to python, witch not only has django and others for web applications, but is also commonly used as scripting language in li...
Hi, all
Is it possible for a shell script to test whether it was executed through source? That is, for example,
$ source myscript.sh
$ ./myscript.sh
Can myscript.sh distinguish from these different shell environments?
Thanks
...
I have an application (the source for which I don't have), which can be invoked from command line like this
$ ./notmyapp
I want to know all the locations where the application is writing to. It outputs some files in the directory it is being called from, but I need to make sure that those are the only files that are created.
So, I ne...
i want to list only the directories in specified path(ls don't have such option).
Also, can this be done with a single line command?
...
I have a file and a lot of process (and process threads) are accessing it.
I want to monitor the file to get a listing of what all processes tried to access the file. Being able to record the timestamps also would be excellent for logging purposes, though I can do without it.
Is there any Unix utility that does something similar?
In c...
Are there any shell (specifically bash or ksh) checkers that test shell scripts for style, best practices, naming conventions, etc? (Something like Lint for C, or Perl::Critic for Perl.)
I know with ksh you can do syntax checking by running ksh -n script.ksh but I was hoping for something more than just sytax checking - something that ...
How to capture all keyboard strokes using shell script .Is there any command that is related to keyboard activities.
...
Hi,
I'm very new in programming. The following task looks very simple but I don't know how to do it. Appreciate if anyone can give me some guidance.
I'm using Linux OS. I would like to create a CLI program and let the user run it in shell terminal. I plan to use Bash shell script to create this program, but C++ or Perl should be ok too...
That is, going from ABCD -> ABC
...
What I'd like to achieve is the launch of the following shell command:
mysql -h hostAddress -u userName -p userPassword
databaseName < fileName
From within a python 2.4 script with something not unlike:
cmd = ["mysql", "-h", ip, "-u", mysqlUser, dbName, "<", file]
subprocess.call(cmd)
This pukes due to the use of the redirect symb...