Sponsored Content
Top Forums Shell Programming and Scripting diffrent results between command line and scripted grep Post 43867 by r1500 on Monday 24th of November 2003 12:56:41 PM
Old 11-24-2003
diffrent results between command line and scripted grep

When I type a command at the command line it supplies one result and the exact same command in a script


egrep '^01|^02|^03|^04' file > fileout

count = 29353

same count in the script yields a count of 23492

is there any reason this could be happening.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

My ps -ef|grep command results are chopped off

On our one HP-UX 11i box, we have some very long paths defined. When I want to check on our user processes running, the resulting paths are chopped off. /xyz/abc/123/......./server/b is really a process running in the ..../server/bin directory. Is this a terminal problem or buffer length... (1 Reply)
Discussion started by: bsp18974
1 Replies

2. UNIX for Dummies Questions & Answers

grep line command

Hi, Can anyone translate in words what this line command does: ls *.fits | grep -v "Zero\|zero" > objlist Obviously ls *.fits means to list all the fits file, grep looks for a certain word, Zero is a certain fits file, and > objlist , created a list with certain items, but I am not sure what... (3 Replies)
Discussion started by: cosmologist
3 Replies

3. UNIX for Dummies Questions & Answers

Pipe results of Grep Command to LS Comand

I'm using the command grep -l XYZ to get a list of files containing the string XYZ. Then I using the comand ls -l ABC to get the create date timestamp of the each file. I've tried combining the comands using the pipe command, grep -l XYZ | ls -l, but its not working. What am I doing wrong? (3 Replies)
Discussion started by: jhtate
3 Replies

4. UNIX for Dummies Questions & Answers

Displaying the Second Line of the Grep Search Results

Hi I really hope someone can help with the below question. Lets say that I have a file called output.txt and I want to display all of the lines which contain the word ‘disconnect'. I know that this can easily be obtained by using the following command: grep -i disconnect output.txt However,... (6 Replies)
Discussion started by: Sunny Sid
6 Replies

5. UNIX for Dummies Questions & Answers

Acting on results from a grep command

Hi, I am currently reading a tar file and searching for a particular word using grep e.g. Plane. At the moment, if a sentence is found with the word "Plane" the sentence itself is piped to another file. Here is the code i am using; for jar in 'cat jar_file.tar'; do tar -tvf... (3 Replies)
Discussion started by: crunchie
3 Replies

6. Shell Programming and Scripting

sed command to grep multiple pattern present in single line and delete that line

here is what i want to achieve.. i have a file with below contents cat fileName blah blah blah . .DROP this REJECT that . --sport 7800 -j REJECT --reject-with icmp-port-unreachable --dport 7800 -j REJECT --reject-with icmp-port-unreachable . . . more blah blah blah --dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies

7. Shell Programming and Scripting

Grep behaves diffrent upon printf or echo output

Hello I want to check whether certain arguments were passed to the script, and when those are, not doing a log entry. If those arguments are not passed, always do a log entry (*new call*). What currently i have is this: echo "${@}"|grep -q \\- || \ tui-log -e "$LOG" "\r---- New call $$... (4 Replies)
Discussion started by: sea
4 Replies

8. Shell Programming and Scripting

Cannot get results from grep command

Hi, i have a file hello.log which as several line that look like the below 2015-12-07 09:46:56 0:339 120.111.12.12 POST /helloWorld 2015-12-07 09:46:57 0:439 122.111.12.12 POST /helloWorld .... when i grep expecting to see results like the below. ... (6 Replies)
Discussion started by: mohtashims
6 Replies

9. Shell Programming and Scripting

Multiple Results of Grep in one Line/String?

Hello, I have a Textfile sees like this "Word1":aksdfjaksdf "Word2":askdfjalsdkfdlsjfasldfj "This is Word3":asdfkjalskdfj what i need is a string which sees like this Word1;Word2;This is Word3 Conclusion always the text within "" which is before the : i tried it with grep.... (10 Replies)
Discussion started by: SwordMaster
10 Replies

10. UNIX for Beginners Questions & Answers

Grep command to show the number of results

Hi I wanted to know if there is an option in grep command to show the number of results (not the number of lines of findings). Thanks (14 Replies)
Discussion started by: abdossamad2003
14 Replies
stack(n)							Tcl Data Structures							  stack(n)

NAME
stack - Create and manipulate stack objects SYNOPSIS
package require Tcl 8.2 package require struct ?1.2.1? stackName option ?arg arg ...? stackName clear stackName destroy stackName peek ?count? stackName pop ?count? stackName push item ?item ...? stackName size DESCRIPTION
The ::struct::stack command creates a new stack object with an associated global Tcl command whose name is stackName. This command may be used to invoke various operations on the stack. It has the following general form: stackName option ?arg arg ...? Option and the args determine the exact behavior of the command. The following commands are possible for stack objects: stackName clear Remove all items from the stack. stackName destroy Destroy the stack, including its storage space and associated command. stackName peek ?count? Return the top count items of the stack, without removing them from the stack. If count is not specified, it defaults to 1. If count is 1, the result is a simple string; otherwise, it is a list. If specified, count must be greater than or equal to 1. If there are no items on the stack, this command will return count empty strings. stackName pop ?count? Return the top count items of the stack, and remove them from the stack. If count is not specified, it defaults to 1. If count is 1, the result is a simple string; otherwise, it is a list. If specified, count must be greater than or equal to 1. If there are no items on the stack, this command will return count empty strings. stackName push item ?item ...? Push the item or items specified onto the stack. If more than one item is given, they will be pushed in the order they are listed. stackName size Return the number of items on the stack. KEYWORDS
queue, matrix, tree, graph struct 1.2.1 stack(n)
All times are GMT -4. The time now is 11:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy