LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-29-2005, 11:31 PM   #16
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 14.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30

Im interested in what gilead mentioned - #!/usr/bin/perl folloowing perl code.
So if I have test.php in my user account folder,
Code:
#!/usr/bin/php

<?php
echo 'hello';
?>
should type hello right ?

But why is other stuff getting printed too ?

[username@myserver username]$ ./test.php
Content-type: text/html
X-Powered-By: PHP/4.3.11


hello[username@myserver username]$


And btw, why isnt ls displaying hidden files ? Im seeing some other files (font colour is grey so I've assumed hidden) in WinSCP.

Thanks
 
Old 12-29-2005, 11:44 PM   #17
nitinatindore
Member
 
Registered: Dec 2004
Location: India
Distribution: Mandrake, Mandriva, PclinuxOS
Posts: 114

Rep: Reputation: 15
Post

Quote:
Originally Posted by MidnightCmdr
One last detail; the first line of an executable script should be a "shebang line". This is a line that starts with

#![path to shell goes here]
Not really required for a simple shell script. Though a good programming practise, but no harm if you dont include anything,try out this simple example:

$cat > blah
ls
echo $HOME
who am i
^D
$chmod u+x blah
$./blah

The above script will run with flying colors.
 
Old 12-30-2005, 08:50 AM   #18
MidnightCmdr
LQ Newbie
 
Registered: Oct 2004
Location: Austin TX
Distribution: Debian
Posts: 17

Rep: Reputation: 0
pljvaldez: The global Bash profile is usually /etc/profile. Also, there's a slight difference between .bashrc and .bash_profile. The .bashrc is sourced when Bash is called as a non-login shell, and the other when it's called as a login shell (if .bash_profile isn't there, it looks for .profile).
 
Old 12-30-2005, 11:54 AM   #19
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
anjanesh,

The reason ls doesn't show hidden files is that there are other options you must pass to the command. Type man ls to learn more, but to see hidden files as well as regular files type ls -a, to see the files as a list with other information, type ls -l, to see all files (hidden included) as a list, type ls -al. I almost always use ls -l because I'm a nerd and like to see lots of data.

MidnightCmdr,

Thanks for the clarification. That explains why I don't have colors for ls when I login to shell instead of gdm...
 
Old 12-30-2005, 12:15 PM   #20
anjanesh
Member
 
Registered: Sep 2004
Location: Navi Mumbai
Distribution: Ubuntu 14.04 64-bit
Posts: 230

Original Poster
Rep: Reputation: 30
Cool ! Thanks ! Anyway I got this much running so far.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there an equivalent of autoexec.bat in debian? Akhran Debian 5 09-13-2005 05:58 PM
What is the autoexec.bat and config.sys equivalent of linux lemuel Linux - Newbie 4 12-07-2004 09:34 PM
Linux Startup - AutoExec.bat equivalent? perry Linux - Software 6 05-03-2004 11:13 PM
.bat file equivalent in linux? Gnute Linux - General 5 08-17-2003 09:21 AM
Autoexec.bat Equivalent dwpondscum Linux - Distributions 5 06-16-2003 09:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration