Go Back   The UNIX and Linux Forums > Homework and Emergencies > Emergency UNIX and Linux Support !! Help Me!!


Emergency UNIX and Linux Support !! Help Me!! Post your urgent questions here for highest visibility. Posting a new thread to this forum requires Bits. We monitor this forum to help people with emergencies, but we do not guarantee response time or answers. This forum is "best effort" only. Members who reply to posts here receive a bonus of 1000 Bits per reply.

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-28-2013
Registered User
 
Join Date: Jan 2013
Posts: 28
Thanks: 18
Thanked 0 Times in 0 Posts
How to use read the char * from file?

i have a file 1.txt. the file contains:
* server1.com : ewf,wefwef,wef,wef
-------------------------------------
* server2.com : ewf,wefwef,wef,wef
-------------------------------------
* server3.com : ewf,wefwef,wef,wef
-------------------------------------

how can i read * ? from the start of the line?

the is the code
Code:
#!/bin/bash

while read line
do
[[ "$line" =~ ^*server1.com ]] && url=${line##*: }

done < 1.txt

for U in ${url//,/ }
do
printf "http://$U.com\n"
done

it doesnt work...........
Sponsored Links
    #2  
Old 02-28-2013
RudiC RudiC is offline Forum Advisor  
Registered User
 
Join Date: Jul 2012
Location: Aachen, Germany
Posts: 1,881
Thanks: 25
Thanked 434 Times in 420 Posts
Double posting not allowed.
Sponsored Links
    #3  
Old 02-28-2013
Registered User
 
Join Date: Jan 2013
Posts: 28
Thanks: 18
Thanked 0 Times in 0 Posts
what should i do? remove?

Quote:
Originally Posted by RudiC View Post
Double posting not allowed.
---------- Post updated at 08:55 AM ---------- Previous update was at 04:48 AM ----------

someone please??
    #4  
Old 02-28-2013
Yoda's Avatar
Jedi Master
 
Join Date: Jan 2012
Location: Galactic Empire
Posts: 2,285
Thanks: 151
Thanked 729 Times in 701 Posts
I have answered your other thread
The Following User Says Thank You to Yoda For This Useful Post:
zigizag (02-28-2013)
Sponsored Links
    #5  
Old 02-28-2013
Mead Rotor
 
Join Date: Aug 2005
Location: Saskatchewan
Posts: 16,374
Thanks: 491
Thanked 2,535 Times in 2,418 Posts
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.
The Following User Says Thank You to Corona688 For This Useful Post:
zigizag (02-28-2013)
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
error: invalid conversion from ‘const char*’ to ‘char*’ GSO Programming 8 06-09-2011 12:39 PM
concat const char * with char * nicos Programming 4 02-18-2009 12:01 PM
Adding a single char to a char pointer. pallak7 Programming 5 12-06-2008 10:46 PM
How to replace any char with newline char. mightysam Shell Programming and Scripting 5 09-18-2008 08:15 PM
need shell script to get last 10 char from a file name and write in to a new file raj0390 Shell Programming and Scripting 2 07-28-2008 07:09 AM



All times are GMT -4. The time now is 11:51 PM.