Forum: Shell Scripting Jul 21st, 2006 |
| Replies: 12 Views: 5,603 If you use code tags your post would be a little easier to read. Try this
pwd | sed "s/\/home\/httpd\/vusers\/*.domain.com\/web_users\/chris2/\/chris.domain.com\/web_users\/chris2/g"
I am not... |
Forum: Shell Scripting Jul 21st, 2006 |
| Replies: 12 Views: 5,603 Since the forward slash has special meaning, you need to escape it. By placing a backslash in front of the forward slash, all of the special meaning is removed(escaped). for example my home directory... |
Forum: Shell Scripting Sep 13th, 2005 |
| Replies: 1 Views: 2,730 writing a shell script that would ask these questions would be easy. The problem is getting this script to run before entering any runlevel. The very first thing the program init does is checks the... |
Forum: Shell Scripting Sep 12th, 2005 |
| Replies: 4 Views: 6,522 your welcome :-)
is it doing what you want it to? |
Forum: Shell Scripting Sep 12th, 2005 |
| Replies: 4 Views: 6,522 without really looking hard at the code, these variable declarations will not work
this one the space can't be used
HLDS= /hlds/cstrike/
it needs to be
HLDS=/hlds/cstrike
also this will... |
Forum: Shell Scripting Aug 10th, 2005 |
| Replies: 3 Views: 5,032 the problem seems that the variable $job_id is not being set. I would look at the export command you are using. What value exactly are you trying to export? |
Forum: Shell Scripting Aug 8th, 2005 |
| Replies: 8 Views: 8,890 echo "please do not close this window until promted, this may take awhile"
sorry, I was trying to be funny. I am not sure how to do waht you wnat. |
Forum: Shell Scripting Aug 7th, 2005 |
| Replies: 3 Views: 5,195 I am not really following you. If you just want to know how long the script runs for in seconds. you can just place this line last in the script
#!/bin/sh
echo $SECONDS #this line will echo 0,... |
Forum: Shell Scripting Aug 3rd, 2005 |
| Replies: 3 Views: 4,400 you need to do two things
1) use single quotes with sed, not double quotes
sed 's/word/subtitute/'
2)also make sure you escape all instances of "/" like this "\/". Make sure you do not escape... |
Forum: Shell Scripting Aug 3rd, 2005 |
| Replies: 3 Views: 4,400 sed can be used properly if it is quoted using single quotes, and also escaping(takes away special meaning) some characters with this"\" . lets say I have a text file with these four lines. I saved... |
Forum: Shell Scripting Aug 2nd, 2005 |
| Replies: 3 Views: 2,875 I can be a little slow understanding stuff, is this what you mean
shane@mainbox shane $ input=company.domain.com
shane@mainbox shane $ echo $input | sed "s/.domain.com//"
company |
Forum: Shell Scripting Aug 2nd, 2005 |
| Replies: 3 Views: 2,875 is this what you want
read INUPT
the user enters company@gmail.com
you want INPUT to equal just 'company' |
Forum: Shell Scripting Aug 2nd, 2005 |
| Replies: 9 Views: 36,538 you might get some ideas from this
#!/bin/bash
echo "enter password"
read PASSWORD
echo "enter email address"
read EMAIL
echo "enter username"
read USER_NAME |
Forum: Shell Scripting Aug 2nd, 2005 |
| Replies: 12 Views: 5,603 the g means global. if you do not use the g, only the first instance of the sting is changed. In you case, you would not need the g
sed "s/text/sub_text/" |
Forum: Shell Scripting Aug 2nd, 2005 |
| Replies: 12 Views: 5,603 if hello is the name of the file put it at the end. using the -i option changes your original file. You would want to keep your original unchanged, so it can be used as a template.
this would... |
Forum: Shell Scripting Aug 2nd, 2005 |
| Replies: 9 Views: 36,538 |
Forum: Shell Scripting Aug 2nd, 2005 |
| Replies: 12 Views: 5,603 for this example I will take the file an an input and make a new file as its output
sed -i "s/string/new_string/g"
this code will substitute all instances of 'string' with 'new_string'
if you... |
Forum: Shell Scripting Aug 2nd, 2005 |
| Replies: 9 Views: 36,538 I think you use input redirection for the body(your email file) by placing the file at the end with a '<' will redirect it to the mail command
mail -s "subject" chris.collins@fuse.net < email
the... |
Forum: Shell Scripting Aug 2nd, 2005 |
| Replies: 12 Views: 5,603 cat piped to grep can check to see if a line of text contains a string. the sed command is more suited for editing files. Sed is a good utility to modify text. Sed is good at deleting strings and... |
Forum: Shell Scripting Aug 2nd, 2005 |
| Replies: 9 Views: 36,538 from other posts I have read, would something like this work?
mail -s "subject" user_name@email_address.com < email_file
show me what you have done, and how it is failing. |
Forum: Shell Scripting Aug 2nd, 2005 |
| Replies: 9 Views: 36,538 what have you come up with so far? I can write a basic script, but don't have any experience using the mail command. |
Forum: Shell Scripting Aug 1st, 2005 |
| Replies: 2 Views: 2,195 so you want this output
John Thompson Cher
John Jacobs Davinder Singh
Dean Johnson Sandeep Jain
to look like this
John Thompson Cher
John Jacobs Davinder Singh |
Forum: Shell Scripting Aug 1st, 2005 |
| Replies: 17 Views: 91,489 I personally have never used mail or sendmail. |
Forum: Shell Scripting Jul 31st, 2005 |
| Replies: 17 Views: 91,489 it seems earthlink is trying to prevetn spam. That may be tough to get around |
Forum: Shell Scripting Jul 31st, 2005 |
| Replies: 4 Views: 7,457 I had my doubls about that command, I have never used 'mail' before. I do not have it installed, so I have no way of testing it. If I was to guess it would be something like this.
mail $email -s... |
Forum: Shell Scripting Jul 30th, 2005 |
| Replies: 9 Views: 3,268 your welcome. I had fun doing it, and learned some stuff in the process :-) |
Forum: Shell Scripting Jul 30th, 2005 |
| Replies: 9 Views: 3,268 you can do it with a program called links, it is a text web browser. this code will substitute the number given, then put the code into a file called temp
#!/bin/bash
echo "enter the phone number... |
Forum: Shell Scripting Jul 30th, 2005 |
| Replies: 9 Views: 3,268 before even writing a scripts you need a program(command) to get the source code. for instance this will download the soucecode of a page
wget http://www.daniweb.com/techtalkforums/thread7215.html... |
Forum: Shell Scripting Jul 30th, 2005 |
| Replies: 9 Views: 3,268 when you say contents, do you mean the page source code of the URL?
if so I will have to research that abit. |
Forum: Shell Scripting Jul 30th, 2005 |
| Replies: 9 Views: 3,268 I am having a little trouble following your code. could you explain what both lines of code are supposed to be doing?
isn't the 'system' command used in the C language? Are you trying to write the... |
Forum: Shell Scripting Jul 30th, 2005 |
| Replies: 4 Views: 7,457 just one more thought. for your code thie the while statment to work, the mail program must be deleteting the emails as they are sent. If it does not delete them, it will just send the first email... |
Forum: Shell Scripting Jul 30th, 2005 |
| Replies: 4 Views: 7,457 first off if your want you code to look better when posting to this forum use bb code tags
http://www.daniweb.com/techtalkforums/announcement113-3.html
Bash is kind of picky, you need to use... |
Forum: Shell Scripting Jul 28th, 2005 |
| Replies: 2 Views: 2,459 I like a good book my self, "sams teach yourself shell programming in 24 hours". was nice and easy to follow.
probably the most complete guide to follow would be the following, this is bash... |
Forum: Shell Scripting Jul 24th, 2005 |
| Replies: 27 Views: 16,145 I was thinking about that script, using the tr command to splice off the letters will fail on any file name that contain numbers. The following command will fail becaise it will also remove numbers... |
Forum: Shell Scripting Jul 23rd, 2005 |
| Replies: 5 Views: 7,565 you can use this to check to see if your script has any characters other then numbers or letters
[[ ${VAR} == *[^a-bA-B1-9]* ]]
this will return a 0 if any non letters or numbers are found.
It... |
Forum: Shell Scripting Jul 23rd, 2005 |
| Replies: 5 Views: 7,565 this will check if the lenght is between 6 and 11
((${#PASS} >= 6)) && ((${#PASS} <= 11))
this will check if you have at least one lowecase letter
[[ $VAR == *[a-z]* ]]
this will check if... |
Forum: Shell Scripting Jul 23rd, 2005 |
| Replies: 5 Views: 7,565 I am kind of learning as I go. you are able to test for length of a string using this method
var='abcdef'
echo ${#var}
so this will test for a variable with the lengths inbetween 6 and 11
... |
Forum: Shell Scripting Jul 22nd, 2005 |
| Replies: 2 Views: 2,148 what do you mean new lines per second? are you looking for a rate? Example
20 newlines/second |
Forum: Shell Scripting Jul 22nd, 2005 |
| Replies: 2 Views: 3,106 bash only allows you to start variables with letters. You can have a number in the variable, but not at the begiinging. the varaiable d4='something' will be ok, but 4d='something' will not work. So... |
Forum: Shell Scripting Jul 21st, 2005 |
| Replies: 27 Views: 16,145 I have an idea. Maybe on solaris the output of wc -m is different. on linux the output ofwc -m file_name
is
23 file_name
this is assumbing there is 23 characters.
what does the output of wc... |