Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. g2345c

    send command from another machine

    I am new to perl and need help with this quetion. from machine A, I log into machine B. How do I from machine A open a terminal on machine B and execute command "pwd"? What perl module i should use? please help Thanks
  2. g2345c

    VC++ API for build automation

    Hi all, We want to have a build automation using VBscript and MS Visual Studio. Can some one share what they have or please point me to a place to learn how to do it? Thanks
  3. g2345c

    Build automation

    CAn't find it through search. I can't Can someone please show me how to steup an automation build for VC++ IDE? either perl/vb or command line or VC++ API? I am tasked to work on it but dont know where to start, so i start here. Please help Thanks
  4. g2345c

    Need help with awk or sed

    Hi, Please help me to write an awk or sed statement that do: 1. if see any line that started with "local0." (local0 follow by a dot) replace the entire line with "local0.debug /var/test" 2. If I dont see any line that started with "local0." append "local0.debug /var/test" to the file here...
  5. g2345c

    need help with a simple awk statement

    hi, I want to add a line to file new.log if /var/log/new.log is not presented in the file. But it add: $A_STRING /var/log/new.log instaed of local0.debug /var/log/new.log #!/bin/sh A_STRING=local0.debug awk '/\/var\/log\/new.log/{++n}{print}END{if(!n)print "\n$A_STRING...
  6. g2345c

    need help with Sed

    Thanks a lot it work perfectly. I want to enhance this script so that if string ";none" not presented before the "Tab" then add it. If it's already there then dont add it. How do I check in this statement? sed -e '/\*.info/bl1' -e '/\*.warning/bl1' -e '/\*.notice/bl1' -e '/\*.err/!b' -e ':l1'...
  7. g2345c

    need help with Sed

    Thanks PHV, it works perfectly. For Education purposes. If I wish to add *.warning and *.notice to the list How do I do it? Thanks
  8. g2345c

    need help with Sed

    Hi PHV, I try it and it say "sed: -e expression #1, char 40: Extra characters after command" here is the file.txt *.info;mail.none;news.none;authpriv.none;cron.none /var/log/messages *.err;mail.none;news.none;authpriv.none;cron.none /var/log/message Please help Thanks
  9. g2345c

    need help with Sed

    I want to search a text file for any line that has "*.info" or "*.err", If i found it I insert the string ";none" before the 'tab'. I sucessfully do either "*.info" or "*.err" but dont know how to do both on the same line. Please help. How do I put a 'or' statement in the below line to also...
  10. g2345c

    A common way to parse cmd line arguments w. switches

    while ($OPTION = shift 2ARGV) { if ($OPTION eq "-f") { $filename = shift @ARGV; } elsif ($OPTION eq "-m") { $mode = shift @ARGV; } else { print "Unknown option"}; } ex: program.pl -f foo.c -m read -Nguyen
  11. g2345c

    Please help with sed/awk issue

    I want to do the following but have no clue. Please suggest. 1) I want to search in a file "config.txt" for a line that started with "*" follow by anything, then "LOG" then "one or more tab" then /var/log (ex: *124adfadf;*LOG /var/log). If I found this line I want to remove "LOG" and save...
  12. g2345c

    Help to modify a file --- sed question I guess

    Works great .. Thanks for your help
  13. g2345c

    Help to modify a file --- sed question I guess

    Hi, Try and it doesn't work. Please help linuxbuild : /home/hb >more test.sh #!/bin/sh sed -e '/"\*one;twothree.*FOO/b' -e'/"\*one;twothree/s/ /FOO /' foo2.txt linuxbuild : /home/hb >more foo2.txt hb test *one;twothree linuxbuild : /home/hb >./test.sh hb test *one;twothree linuxbuild : /home/hb >
  14. g2345c

    Help to modify a file --- sed question I guess

    hi, How do I do this? i want to search entire file foo.txt for string that started with "*one;twothree". Then see if that string contain string "FOO" or not. if Not Replace the first white-space with "FOO" sed '/"*one;twothree/[HOW DO I CHECK FOR FOO HERE]s/ /FOO /' foo.txt thanks
  15. g2345c

    Help? How to remove starting white-space

    Thank you all. It works great.
  16. g2345c

    Help? How to remove starting white-space

    #!/bin/sh IP_ADDRESS=`/sbin/ifconfig | grep inet` ex: the $IP_ADDRESS now is: " inet Ip: Mask:" How do I remove the all the white-space at the begining of $IP_ADDRESS if any line before move on to the next statement? so that $IP_ADDRESS will become "inet Ip: Mask:" thanks
  17. g2345c

    Need help with a 'sed' problem

    Thank you very much ... It's worked :-) ... How do I tell sed to to save the foo.txt file after replace the first tab with GOT.IT? Thanks
  18. g2345c

    Need help with a 'sed' problem

    Wow... Cool it's a tab not a space. So how do you replace a tab. I try \t but it doesnt wotk. it replaces the t instead of a tab. Sorry, I am a newbie and is learing this stuff. Thanks a lot sed '/info;mail/s/\t/GOT.IT /' foo.txt info;mail.none;auGOT.IT hpriv.none;cron.none...
  19. g2345c

    Need help with a 'sed' problem

    Hi, Please help me why it doesn't work for me. Thanks linuxbuild : /home/g2345c >sed '/info/s/ /GOT.IT /' foo.txt info;mail.none;authpriv.none;cron.none /var/log/messages # The authpriv file has restricted access. authpriv.*...
  20. g2345c

    Need help with a 'sed' problem

    Sorry, it should be foo.txt ... Typo. thanks

Part and Inventory Search

Back
Top