Sponsored Content
Full Discussion: Grep command error
Top Forums Shell Programming and Scripting Grep command error Post 302788265 by pratima.kumari on Monday 1st of April 2013 11:48:43 AM
Old 04-01-2013
Grep command error

I am using a command but getting an error despite of modifying it many times.
Code:
Pattern=`grep story file|cut -c 19-24`

Where as 'story' is the pattern to be matched and i want to cut the value of characters ranging from 19 to 24 when this pattern is found in a variable.

file consists of below log:

A short story is a brief work of literature
usually written in narrative prose
Emerging from earlier oral telling traditions


Am I doing something wrong. This command is being written in a shell script

Last edited by Scrutinizer; 04-01-2013 at 01:01 PM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep command

Hi, I'd like to use grep command to filter something from all the directories that above my directory. How do I do that? I tried 'grep something ./*' but I didn't get anything which I knew there is something inside one of the subdirectory. thnks! (3 Replies)
Discussion started by: whatisthis
3 Replies

2. UNIX for Advanced & Expert Users

how to exclude the GREP command from GREP

I am doing "ps -f" to see my process. but I get lines that one of it represents the ps command itself. I want to grep it out using -v flag, but than I get another process that belongs to the GREP itself : I would like to exclude # ps -f UID PID PPID C STIME TTY TIME CMD... (2 Replies)
Discussion started by: yamsin789
2 Replies

3. Shell Programming and Scripting

can anyone help with shell script command about searching word with grep command?

i want to search in the current directory all the files that contain one word for example "hello" i want to achieve it with the grep command but not with the grep * (2 Replies)
Discussion started by: aintour
2 Replies

4. Shell Programming and Scripting

Grep Command

Hi, I Want to grep the 500th character of a line in a file. please help on this. Thanks in advance (7 Replies)
Discussion started by: raghulshekar
7 Replies

5. Shell Programming and Scripting

grep only last occurred error in error.log,

hi folk i need your help to find one logic.... i have error log same as any other error logs which get populated by no of events and errors... but i need to grep the last occured errors.. which cant be duplicate. here is my script. ======================== #!/usr/bin/ksh grep -i... (3 Replies)
Discussion started by: tapia
3 Replies

6. Shell Programming and Scripting

Help with using grep command with copy command

Hi, im taking an entry Unix class, and as part of my lab assignment I have to copy all files in the /home/david/lab3 directory that have the file extension .save to your lab3/temp directory. I'm having trouble getting the grep to do anything worth while I've been trying to do: cp... (6 Replies)
Discussion started by: Critical jeff
6 Replies

7. UNIX for Dummies Questions & Answers

how to use And/Or in grep command?

dears how can i use And/Or in grep expression? thanks alot (3 Replies)
Discussion started by: thehero
3 Replies

8. Shell Programming and Scripting

Supressing error while using grep command

I am tryin to grep some pattern in file and redirecting it in to another file. If the file doesn't exist then it should not throw error. eg : grep "pattern" "$path1/filename" >> newfile I have multiple number of grep statement like this. so i cant check each and every is exist or not... ... (1 Reply)
Discussion started by: arukuku
1 Replies

9. UNIX for Dummies Questions & Answers

Grep command

I am using below command to grep a string in all the dir/subdir: find /home -exec grep 'balance1212' {} /dev/null \; I'm getting a lot of lines like below: grep: can't open /home/shared/argr find: cannot open /home/shared/srpt/.ssh I want to see only the file having the string... (1 Reply)
Discussion started by: ravigupta2u
1 Replies

10. Shell Programming and Scripting

Grep command giving different result for different users for same command

Hello, I am running below command as root user #nodetool cfstats tests | grep "Memtable switch count" Memtable switch count: 12 Where as when I try to run same command as another user it gives different result. #su -l zabbix -s /bin/bash -c "nodetool cfstats tests | grep "Memtable switch... (10 Replies)
Discussion started by: Pushpraj
10 Replies
Holotz's Castle Editor(6)												 Holotz's Castle Editor(6)

NAME
holotz-castle-editor - editor for holotz-castle game SYNOPSIS
holotz-castle-editor [-f] [-w] [--fps nn] [-mWWxHHxBPP] [-r RR] [-c CC] [-t theme] <story> <nr> DESCRIPTION
A great mystery is hidden beyond the walls of Holotz's Castle. Will you be able to help Ybelle and Ludar escape alive from the castle? Use the editor to design new levels for this game! USAGE
You can use the following keys while working with the editor: - Page Down: Next level in the story (or a new one if it doesn't exist). - Page Up: Previous level in the story. - 'c': Increase the number of columns from the right. - CTRL-'c': Increase the number of columns from the left - SHIFT-'c': Decrease the number of columns from the right. - SHIFT-CTRL-'c': Decrease the number of columns from the left. - 'r': Increase the number of rows from below. - CTRL-'r': Increase the number of rows from above. - SHIFT-'r': Decrease the number of rows from below. - SHIFT-CTRL-r: Decrease the number of rows from Above. - '+': Increase level time. - '-': Decrease level time. - '1': Select 'floor' tool. - '2': Select 'continuous floor' tool. - '3': Select 'stairs' tool. - '4': Select 'bar' tool. - '5': Select 'breakable floor' tool. - '6': Select 'key' tool. - '7': Select 'rope' tool - '8': Select 'starting character's position' tool. - '9': Select 'exit position' tool. - '0': Select 'enemy' tool. - 's': Save. - CTRL-'q': Quit editor. - Arrow keys: Move around in the map. - 'g': Increase gravity strength. - SHIFT-'g': Decrease gravity strength. - 'x': Increase main character's speed in axis. - SHIFT-'x': Decrease main character's speed in X axis. - 'y': Increase main character's speed in Y axis. - SHIFT-'y': Decrease main character's speed in Y axis. - 'j': Increase the number of cells that the player can jump vertically. - SHIFT-'j': Decrease the number of cells that the player can jump vertically. Other features: - When adding an item to the map, if you press CTRL key it is adjusted to a cell. - To adjust a rope's lenght, you select it and, while still pressing mouse button, press ALT key and drag the mouse vertically until get- ting the desired length. - To adjust a rope's oscillation amplitude, you must select it and, keeping mouse button pressed, press SHIFT key. Real time amplitude is not shown, as it is determined taking into account the distance in vertical to the rope when releasing mouse button. OPTIONS
These command line options are available: -f Full Screen. -w Windowed. --fps nn Run the game at nn frames per second (fps). -mWWxHHxBPP Run in video mode set by WW pixels of width, HH pixels of height and BPP bits per pixel (eg. -m640x480x16). -r RR Crete map with RR rows of height. -c CC Crete map with CC columns of width. -t theme Use theme named 'theme'. <story> <nr> Load level nr of the story called 'story'. AUTHOR
This manual page was written for the Debian GNU/Linux system by Miriam Ruiz <little_miry@yahoo.es> (but may be used by others, of course) Miriam Ruiz 28.01.2005 Holotz's Castle Editor(6)
All times are GMT -4. The time now is 01:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy