Sponsored Content
Top Forums Shell Programming and Scripting redirect the grep output into the variable Post 302183110 by era on Tuesday 8th of April 2008 09:46:15 AM
Old 04-08-2008
Do you get any error message? What's in $logdir? What's in $veri and $vari after these commands?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

redirect command output to variable

Hi, I am looking for a way to redirect the result from a command into a variable. This is the scenario. Using the find command I will be getting multiple records/lines back. Here is the command I am using: find /”path”/ -name nohup.out -print This now is giving me the paths and file... (1 Reply)
Discussion started by: hugow
1 Replies

2. UNIX for Dummies Questions & Answers

Redirect Output In Variable

how make assign the output of the command (for example: grep "file" "string" ) in a variable ($name)? i thing how put the result of the command (grep , cut, find ecc) in a variable.. IT's Possible ?? (1 Reply)
Discussion started by: ZINGARO
1 Replies

3. Shell Programming and Scripting

awk redirect output to shell variable

I'm trying to redirect awk's output to a BASH variable. Currently the statement looks like this options=`awk '{ while (i < NF) { print $i; ++i } }' answer but for some reason that makes $options look like this: 1 2 3 4 1 2 3 Now, the input file 'answer' is taken from a dialog... (3 Replies)
Discussion started by: dhinge
3 Replies

4. Shell Programming and Scripting

after grep i want to redirect it to some variable

for the below grep -i $1 "${logdir}"* | grep -i adding | grep -iv equation | tail -1 | cut -d ':' -f 1 the result of the grep i want to redirect into some variable, i tried to do veri=grep -i $1 "${logdir}"* | grep -i adding | grep -iv equation | tail -1 | cut -d ':' -f 1 but it is... (2 Replies)
Discussion started by: mail2sant
2 Replies

5. Shell Programming and Scripting

Redirect grep output into file !!!!!

Hi, I am writing the following code in command prompt it is working fine. grep ',222,' SAPPCO_20080306.CSV_old > SAPPCO_20080306.CSV_new But the command is not working in the Shell Script... ########################################## #!/bin/sh #... (2 Replies)
Discussion started by: hanu_oracle
2 Replies

6. Shell Programming and Scripting

Redirect grep output to dynamique fileName and subdirectory

Hi all i'm new in KSH, i want to write a script to grep a logs files and redirecting the result into a relative subdirectory/file.txt that must be created near to each log file my begin script is : find ./logs -type f -name "*.log" -exec grep error {} \; how i can perform that modest... (10 Replies)
Discussion started by: rambler
10 Replies

7. UNIX and Linux Applications

How to redirect grep command output to same file

Hi Everyone, Can anyone please tell me, how can I redirect the grep command output to same file. I am trying with below command but my original file contains no data after executing the command. $grep pattern file1 > file1 Kind Regards, Eswar (5 Replies)
Discussion started by: picheswa
5 Replies

8. Shell Programming and Scripting

Redirect output from SQL to unix variable

Hi, I have a requirement to store oracle sqlplus output to some unix variable, count the records and then print the output on the screen. Can you please point me to any sample program for reference purpose. Thanks a lot for your time. (0 Replies)
Discussion started by: bhupinder08
0 Replies

9. Shell Programming and Scripting

How to redirect 'crontab' output to a variable?

I'm trying to redirect the output of crontab to a variable named "crontab_status" as below: crontab_status=$(crontab -l) executing the script is not redirecting to the variable. Please help! (6 Replies)
Discussion started by: mjavalkar
6 Replies

10. Shell Programming and Scripting

Redirect script output to file after grep

i have simple program that generate log file 1 line every sec, i need to do grep for specific record then redirect to another file. #!/bin/bash for i in `seq 1 20`; do echo $i sleep 1 done ./test.sh |egrep "5|10|15" 5 10 15 r ./test.sh... (2 Replies)
Discussion started by: before4
2 Replies
FORMAT(1)						      General Commands Manual							 FORMAT(1)

NAME
format - format a PC floppy diskette SYNOPSIS
format [-v] device [media-size [drive-size]] DESCRIPTION
Format allows a user with read-write permission to device to format a floppy. Either one of the special floppy devices must be used, see fd(4), or an automatic device may be used with the size of the floppy specified on the command line. Two sizes must be given when format- ting a low density diskette in a high density drive. For example: format /dev/at1 format /dev/fd1 1200 format /dev/fd1 360 1200 The first two commands format a 1.2M diskette, the last formats a 360k diskette in a 1.2M drive. A 1.44M drive knows when it's dealing with a low density floppy, so all these commands format a 720k diskette: format /dev/fd0 720 format /dev/fd0 720 1440 format /dev/ps0 No sizes may be specified when using a special floppy device, a size must be specified when using an automatic device. OPTIONS
-v Verify the process by reading each track after formatting it. Formatting is normally blind, the controller has no idea whether it succeeds or not. Use -v on a new box of cheap diskettes, or on a diskette that may have gone bad. Verifying will increase format- ting time by 50%. SEE ALSO
mkfs(1), fd(4). DIAGNOSTICS
Numbers will be printed on standard output to show that it is busy. The locations of bad sectors are printed on standard error when veri- fying. The exit code is zero unless there are too many bad spots. AUTHOR
Kees J. Bot (kjb@cs.vu.nl) FORMAT(1)
All times are GMT -4. The time now is 12:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy