Results 1 to 10 of 19
Hello !!
I'm trying to run this small shell script
Code:
tom:~> cat -n mysystem.sh
8 echo "Today's date is `date`, this is week `date +"%V"`."
9 echo
But the ...
- 10-24-2011 #1Just Joined!
- Join Date
- Oct 2011
- Posts
- 11
Simple problem face a beginner....HELP PLEASE
Hello !!
I'm trying to run this small shell script
But the when i run this,,,,,,here is the result:Code:tom:~> cat -n mysystem.sh 8 echo "Today's date is `date`, this is week `date +"%V"`." 9 echo
Today's date is `date`, this is week `date +"%V"`.
What's wrong ???
thanks
- 10-24-2011 #2Just Joined!
- Join Date
- Aug 2011
- Posts
- 3
works for me, fedora 15 64bit, try your test again. chmod +x your script and run it as: ./mysystem.sh
Today's date is Mon Oct 24 06:59:32 EDT 2011, this is week 43.
cat -n date.sh
1 echo "Today's date is `date`, this is week `date +"%V"`."
2 echo
3
- 10-24-2011 #3Just Joined!
- Join Date
- Oct 2011
- Posts
- 11
thank you
but it didnot work for me
actaully am using centOS
- 10-25-2011 #4
When you type out the command and run it in the terminal, does it work?
linux user # 503963
- 10-26-2011 #5Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Confirmed it works on my CentOS 5.x box.
How are you running it? Have it tried it like:
How about like this?Code:/bin/bash ./mysystem.sh
Code:echo "Today's date is $(date), this is week $(date +%V)."
- 10-28-2011 #6Just Joined!
- Join Date
- Oct 2011
- Posts
- 11
Still not working guys>>>
what to do.........help please
- 10-28-2011 #7Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Try this:
at the top of your script, right below the #!/bin/bash line, put:
Then run the script.Code:set -x
Then post the entire contents of your script.
Then post the entire contents of the script output.
When you do the last two things, be sure to enclose the contents in the CODE brackets, for easier reading.
- 10-28-2011 #8Linux Guru
- Join Date
- Oct 2007
- Location
- Tucson AZ
- Posts
- 1,942
I'd suggest the OP, instead of saying "that didn't work", post the actual commands s/he uses as well as the output. It seems to work for everyone else?
- 10-29-2011 #9Just Joined!
- Join Date
- Oct 2011
- Posts
- 11
Here is the script
this is the outputCode:#!bin/bash set -x echo "this is the ,'date'"
thanksCode:++ echo 'this the ,'\''date'\'' ' this is the,'date'
- 10-29-2011 #10Just Joined!
- Join Date
- Oct 2011
- Posts
- 11
and this is without set -x
this is the outputCode:#!/bin/bash echo "this is the,'date' "
thanks once againCode:this is the ,'date'
waiting for you Pro


1Likes
Reply With Quote