shebang and ubuntu

H

Huge

Why did my locate commands not work? The first should have indicated
that the text file was in the home folder, and the second is in the same
directory whence the locate originates.

man locate
man updatedb

Will give you the answer.
 
H

Huge

/usr/local/bin for anything I write.

It may also be worth noting that for anything more than a few lines of
shell script or perl, use a version control system, else you'll rapidly
forget what's what.

I seem to have Subversion installed on my Ubuntu box, although I suspect
that came with the NetBeans IDE.

[I'm learning Java. :eek:( ]
 
K

Keith Thompson

Phred Phungus said:
dan@dan-desktop:~/source42$ chmod u + x t1.pl
chmod: invalid mode: `u'
Try `chmod --help' for more information.
dan@dan-desktop:~/source42$ chmod u+x t1.pl
dan@dan-desktop:~/source42$ ls -l
total 32
-rw-r--r-- 1 dan dan 2556 2010-02-07 18:46 b1.c
-rw-r--r-- 1 dan dan 2555 2010-02-07 18:46 b1.c~
-rwxr-xr-x 1 dan dan 13344 2010-02-07 18:47 out
-rwxr--r-- 1 dan dan 138 2010-02-08 01:34 t1.pl
-rw-r--r-- 1 dan dan 31 2010-02-08 01:30 t1.pl~
[...]

Personally, I find the repeated occurrences of your rather long
shell prompt districting. They make it more difficult to read the
actual information. I'm sure I'm not the only one who thinks so.

I suggest shortening your prompt to something like "$ ". You can
do this by (carefully!) editing the output after you copy-and-paste
it, but that risks losing information. It's probably safer to
change your prompt, run the commands, copy-and-paste the output,
and then change it back. (I'm not suggesting you should change the
prompt for your own use, only for what you post here.)

For example, the above would be:

$ chmod u + x t1.pl
chmod: invalid mode: `u'
Try `chmod --help' for more information.
$ chmod u+x t1.pl
$ ls -l
total 32
-rw-r--r-- 1 dan dan 2556 2010-02-07 18:46 b1.c
-rw-r--r-- 1 dan dan 2555 2010-02-07 18:46 b1.c~
-rwxr-xr-x 1 dan dan 13344 2010-02-07 18:47 out
-rwxr--r-- 1 dan dan 138 2010-02-08 01:34 t1.pl
-rw-r--r-- 1 dan dan 31 2010-02-08 01:30 t1.pl~

which I find much easier to read.

The only useful part of the prompt is the current directory, but
you could achieve that by using an explicit "cd" command. (It's not
really necessary here, since knowing that you're in ~/source42
doesn't help us.)
 
P

Phred Phungus

Keith said:
Phred Phungus said:
dan@dan-desktop:~/source42$ chmod u + x t1.pl
chmod: invalid mode: `u'
Try `chmod --help' for more information.
dan@dan-desktop:~/source42$ chmod u+x t1.pl
dan@dan-desktop:~/source42$ ls -l
total 32
-rw-r--r-- 1 dan dan 2556 2010-02-07 18:46 b1.c
-rw-r--r-- 1 dan dan 2555 2010-02-07 18:46 b1.c~
-rwxr-xr-x 1 dan dan 13344 2010-02-07 18:47 out
-rwxr--r-- 1 dan dan 138 2010-02-08 01:34 t1.pl
-rw-r--r-- 1 dan dan 31 2010-02-08 01:30 t1.pl~
[...]

Personally, I find the repeated occurrences of your rather long
shell prompt districting. They make it more difficult to read the
actual information. I'm sure I'm not the only one who thinks so.

I suggest shortening your prompt to something like "$ ". You can
do this by (carefully!) editing the output after you copy-and-paste
it, but that risks losing information. It's probably safer to
change your prompt, run the commands, copy-and-paste the output,
and then change it back. (I'm not suggesting you should change the
prompt for your own use, only for what you post here.)

For example, the above would be:

$ chmod u + x t1.pl
chmod: invalid mode: `u'
Try `chmod --help' for more information.
$ chmod u+x t1.pl
$ ls -l
total 32
-rw-r--r-- 1 dan dan 2556 2010-02-07 18:46 b1.c
-rw-r--r-- 1 dan dan 2555 2010-02-07 18:46 b1.c~
-rwxr-xr-x 1 dan dan 13344 2010-02-07 18:47 out
-rwxr--r-- 1 dan dan 138 2010-02-08 01:34 t1.pl
-rw-r--r-- 1 dan dan 31 2010-02-08 01:30 t1.pl~

which I find much easier to read.

The only useful part of the prompt is the current directory, but
you could achieve that by using an explicit "cd" command. (It's not
really necessary here, since knowing that you're in ~/source42
doesn't help us.)

I think Keith's point goes to readability on usenet, which can stand a
couple posts without disrupting anything. I had also wanted to shorten
that prompt, which one does by editting the .bashrc that appears in your
home folder. One replaces occurences of PS1 = ... to export PS1="\$ "
and gets

$ echo "looking better?"
looking better?
$
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,206
Latest member
SybilSchil

Latest Threads

Top