I often getting confused with bash and shell. Are they same? If I want to learn the bash, will it be covered with Linux shell programming related books? I use Ubuntu Linux.
Edit: (Added after getting two answers.) How bash is associated with terminal?
...
Is there any way to define an Erlang function from within the Erlang shell instead of from an erl file?
...
I need to know if the two patches are effectively the same.
I have an old patch file and new patch file created with the unix diff command. Just diff'ing the patches reports differences due to the timestamp when the patch was created.
Is there a way (with diff?) that can reliably tell me if the two patches are effectively the same?
...
I'm writing a shell script that is supposed to be run by users only in sudo user list, what's the appropriate way of doing this?
what I'm thinking is in the shell script, try to create a dummy file in system dir such as /var/run/ and remove it, so users not in sudo list will receive a permission error, but I believe there gotta be a mo...
I have a shell script which is called by a cron job. I don't want it to be downloaded via a browser. I have tried the filesmatch htaccess directive but that doesn't seem to stop me calling the url of the file and downloading it.
How can I protect it?
...
One of the great features of Django is that you can open a python interpreter set-up for use with your project. This can be used to analyse objects in a database and allows any python commands to be executed on your project. I find it essential for Django development. It is invoked in the project directory using this command:
$ python m...
I am trying to store the resulting list from "ls -la" into a variable then filter out some files name, after that print out only the filtered file names (along with the date and stuff like how ls -la does it" again, but when I do that everything is in one line, is there a way to make sure every file name are on different lines?
thanks i...
For my implementation of tail shell command in Linux, I need to read certain amount of lines/bytes from the end of the file using stream input/output. Does anyone have suggestions how to do that? I suspect I need to open a file and pass some parameter to the ifstream constructor, but I don't know what exactly. Googling didn't find anythi...
Instead of running "svn diff", "hg diff" and so on .. can we write a single command that calls svn/hg/git accordingly? Can the diff output be made pretty?
edit: command-line tools (not GUI) preferred.
...
Ok, I can't figure this out from reading Perl's documentation. I'm looking at the RHEL4 init script for Apache... What does this line of code do?
httpd=${HTTPD-/usr/sbin/httpd}
Why not just httpd=/usr/sbin/httpd? What's up with all the extra syntax?
-Geoffrey Lee
...
I would like to create 1000+ text files with some text to test a script, how to create this much if text files at a go using shell script or Perl. Please could anyone help me.
...
I often have shell programming tasks where I run into this pattern:
cat file | some_script > file
This is unsafe - cat may not have read in the entire file before some_script starts writing to it. I don't really want to write the result to a temporary file (its slow, and I don't want the added complication of thinking up a unique new ...
hi
i have bunch of dirs , say *a, b, c0, d, Z , foo, * and so on.
I want to remove all the directories except dirs foo, foo2, a and b
can anyone provide me the syntax to do this shell?
Thanks
UPDATE
I just want to say Thank you to all of you for your responses!
...
I'm trying to write a sh script to make a rails apps, however due to different conflict, I need to modify my environment.rb file to comment out the rails version. So my question is how do I had '#' to line 8 of environment.rb?
...
I want to write a loop in bourne shell which iterates a specific set of numbers. Normally I would use seq
for i in `seq 1 10 15 20`
#do stuff
loop
But seemingly on this Solaris box seq does not exist. Can anyone help by providing another solution to iterating a list of numbers?
Thanks,
Chris
...
In bourne shell I have the following:
VALUES=`some command that returns multiple line values`
echo $VALUES
Looks like:
"ONE"
"TWO"
"THREE"
"FOUR"
I would like it to look like:
"ONE" "TWO" "THREE" "FOUR"
Can anyone help?
...
How can I find out how may character are there in a line before the end line in an interactive shell using python? (Usually 80)
...
I am new to shell scripting and can't figure this out. If you are unfamiliar, the command git branch returns something like
* develop
master
, where the asterisk marks the currently checked out branch. When I run the following in the terminal:
git branch | grep "*"
I get:
* develop
as expected.
However, when I run
test=$(gi...
i'm trying to remove junk files by using
Process p = Runtime.getRuntime().exec();
it works fine as long as i do not use wildcards, i.e. this works:
Process p = Runtime.getRuntime().exec("/bin/rm -f specificJunkFile.java");
while the following throws back "No such file or directory":
Process p = Runtime.getRuntime().exec("/bin/rm -...
There seem to be a few virtual folders which have GUIDs associated to them (control panel, desktop) -
::{00021400-0000-0000-c000-000000000046} // desktop
Where the blazes are these defined? When are they used?
What I want is a way to have a string which represents a virtual folder without any ambiguity.
If, for instance, I were to...