Sponsored Content
Top Forums Shell Programming and Scripting [grep] how to grep a sentence which has quotation marks "sentence" Post 302474712 by jim mcnamara on Thursday 25th of November 2010 05:54:12 AM
Old 11-25-2010
how about
Code:
grep 'alt-speed-enabled' filename | grep -q 'true' && ok=1 || ok=0
if [ $ok -eq 1 ]; then
  zenity -- and so on
fi

you can also use a regular expression in a single grep -q command, but I thought this one would be easier to understand.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep to find content in between curly braces, "{" and "},"

problem String ~~~~~~~~~~~~~~~~~~ icecream= { smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" } aend = {smart vc4 eatr kalu} output needed ~~~~~~~~~~~~~~~~~~ smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies

2. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

3. Shell Programming and Scripting

ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt"

Hi, I don't know hot to make this command work: ls -laR | grep "^-" | awk '{print $9}'| grep "$.txt" It should return the list of file .txt It's important to search .txt at the end of the line, becouse some file name have "txt" in their name but have other extensions (13 Replies)
Discussion started by: DNAx86
13 Replies

4. Shell Programming and Scripting

MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else

Hi Guys, I need to set the value of $7 to zero in case $7 is NULL. I've tried the below command but doesn't work. Any ideas. thanks guys. MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else { print $7}}' ` Harby. (4 Replies)
Discussion started by: hariza
4 Replies

5. AIX

xx=`date +"%a %b %d"`;rsh xxx grep "^$XX" zzz ?

AIX 4.2 I am trying to do an rsh grep to search for date records inside server logs by doing this : xx=`date +"%a %b %d"` rsh xxx grep "^$XX" zzz gives : grep: 0652-033 Cannot open Jun. grep: 0652-033 Cannot open 11. But if I do : xx=`date +"%a %b %d"` grep "^$XX" zzz it works... (2 Replies)
Discussion started by: Browser_ice
2 Replies

6. UNIX for Dummies Questions & Answers

Script to ask for a sentence and then count number of spaces in the sentence

Hi People, I need some Help to write a unix script that asks for a sentence to be typed out then with the sentence. Counts the number of spaces within the sentence and then echo's out "The Number Of Spaces In The Sentence is 4" as a example Thanks Danielle (12 Replies)
Discussion started by: charlie101208
12 Replies

7. Shell Programming and Scripting

ps -ef | grep "string1" "string2" " "string3"

Hi all, can any one suggest me the script to grep multiple strings from ps -ef pls correct the below script . its not working/ i want to print OK if all the below process are running in my solaris system. else i want to print NOT OK. bash-3.00$ ps -ef | grep blu lscpusr 48 42 ... (11 Replies)
Discussion started by: steve2216
11 Replies

8. Shell Programming and Scripting

Problem with "find" and "grep" command

I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank). In a first approach I coded: find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt But this doesn't work. I got an error (under Ubuntu): grep:... (5 Replies)
Discussion started by: pstein
5 Replies

9. Shell Programming and Scripting

grep with "[" and "]" and "dot" within the search string

Hello. Following recommendations for one of my threads, this is working perfectly : #!/bin/bash CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" ) Now I need a grep success for some thing like : #!/bin/bash CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies

10. Shell Programming and Scripting

Failure: if grep "$Var" "$line" inside while read line loop

Hi everybody, I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o My code: #!/bin/sh set -e set -u export IFS= optl="Optl" LOCSTORCLI="/opt/lsi/storcli/storcli" ($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Discussion started by: Subsonic66
5 Replies
alt(7)							 Miscellaneous Information Manual						    alt(7)

NAME
alt - DEGPA Gigabit Ethernet interface SYNOPSIS
config_driver alt DESCRIPTION
The alt interface provides access to Gigabit Ethernet (1000Mbs) through the DEGPA device. The interface supports full-duplex operation in a switched or point-to-point configuration, and provides the following features: The interface has Link Autonegotiation enabled by default. Some switches do not support Link Autonegotiation. To turn Link Autonegotiation off, use the following command: # lan_config -ialt0 -a0 Note that you may add this command to the /etc/inet.local file to preserve the set- ting of Link Autonegotiation across system restarts. JUMBO packets are disabled by default. JUMBO packets provide a non-standard larger packet size. This enables the interface to carry more data with less CPU overhead. To enable JUMBO packets, use the following command: # ifconfig alt0 ipmtu 9000 Note that there are several interoperability issues with using JUMBO packets (for example, if your switch goes from 1000Mbps to a 100Mbps client, JUMBO packets will not work on a 100Mbps LAN). In order to use JUMBO frames, you will need a switch that supports JUMBO frames or a point-to-point configuration with a partner that supports JUMBO frames. Receive flow control is enabled. There is currently no way to turn this off. Gigabit Ethernet performance with TCP/IP depends on several factors. Some of the influencing factors are as follows: The speed at which data can be delivered to the interface influences throughput. If your CPU(s) are busy doing several tasks, the task using Gigabit Ethernet may not get enough run time to deliver packets. In general, faster CPUs will deliver better throughput. Fast access to the PCI bus is critical for high throughput. Using a 64-bit PCI slot will give you better performance and use less PCI resources than a 32-bit PCI slot. Putting the interface on the same PCI bus as other peripherals will degrade throughput. Each system type may also have different PCI-to- host speed considerations (the speed at which the PCI-to-host hardware allows the device to operate). The standard TCP/IP applications (for example, ftp and rcp) are not designed to run at Gigabit speeds. TCP applications that expect performance should use a message size of 65000 bytes and a window size of 128000 bytes. Even when an application is modified to use these settings, high throughput may not be attainable. This is particularly true when an application is waiting for data to send (data from a disk, for example). ERRORS
The following diagnostic and error messages contain relevant information provided by the alt interface, and are displayed to the console. Each message begins with the adapter identification, including the number of the adapter. The alt interface could not find adequate I/O addressing on this system to operate. This is a fatal error, and the DEGPA-SA will not operate on this system. There was a memory alloca- tion problem or the device initialization has failed. This is indicative of a hardware problem. Indicates that the Gigabit Ethernet link is up. The Autonegotiated keyword indicates that the link was autonegotiated. Note, this will only be on if autonegotiation is enabled). The ReceiveFlowControl keyword indicates that Receive Flow control is enabled on the link. Indicates that the link is no longer estab- lished. No communication will occur over the link while it is down. RELATED INFORMATION
Commands: ifconfig(8), lan_config(8) Files: inet.local(4) Network information: arp(7), inet(7), netintro(7) delim off alt(7)
All times are GMT -4. The time now is 11:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy