Set specific part in command output into variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Set specific part in command output into variable
# 8  
Old 08-16-2008
perfect!!

Thanks a lot!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Save an specific part of a expect_out in a variable

I have a expect file like this #!/opt/tools/unsupported/expect-5.39/bin/expect spawn ssh -l user ip expect_after eof {exit 0} set timeout 10 log_file /report.txt expect "Password:" { send "pasword\r" } expect "$ " { send "date\r" } expect "$ " { send "readlink /somelink\r" } set... (7 Replies)
Discussion started by: bebehnaz
7 Replies

2. UNIX for Dummies Questions & Answers

Set Command to output a log of every command executed in the script

Hi Guys, I like to output every command executed in the script to a file. I have tried set -x which does the same. But it is not giving the logs of the child script which is being called from my script. Is there any parameters in the Set command or someother way where i can see the log... (2 Replies)
Discussion started by: mac4rfree
2 Replies

3. Shell Programming and Scripting

Parse output path to set variable

I am looking to parse a text file output and set variables based on what is cropped from the parsing. Below is my script I am looking to add this feature too. All it does is scan a certain area of users directories for anyone using up more than X amount of disk space. It then writes to the... (4 Replies)
Discussion started by: es760
4 Replies

4. Shell Programming and Scripting

set output of linux cmd as a variable in .exp

I am trying to make a script to take commands from a .txt file ( line by line) and pass it using send ( used in another function ) what i am trying to achieve is : set nol "`grep '' ${exp_path2}/cmdlist.txt | wc -l `" as in shell script nol=`grep '' $exp_path2/cmdlist.txt | wc -l` ... (0 Replies)
Discussion started by: dixyantar
0 Replies

5. HP-UX

What is the use of command set -- and set - variable?

Hi, I am using hp unix i want to know the use of the following commands set -- set - variable thanks (4 Replies)
Discussion started by: gomathi
4 Replies

6. Shell Programming and Scripting

BASH - set specific user variable via string operators

Apologies for the utter triviality of this question, but we all have to start somewhere! I've also tried searching but this question is pretty vague so I didn't (a) really know what to search for or (b) get many relevant hits to what I did search for. Anyway, I'm in the process of self-teaching... (1 Reply)
Discussion started by: u5j84
1 Replies

7. Shell Programming and Scripting

set variable to command output

I'm hoping you guys can help me out here. I've been trying different methods to try and get what IW as hoping would be a fairly simple script but has turned into a pain. Bit of background - I am writing a script to check values in certain failes to ensure they are corerct. I'm runnign this on... (2 Replies)
Discussion started by: stuc
2 Replies

8. Shell Programming and Scripting

How to set IFS for a specific command

Hi there, I'm using two commands that need different IFS. The mysql command need IFS to include space because I'm given the mysql command as a variable: supernova:~# cat myscript IFS=' ' MYSQL="mysql -u user -ppassword database" $MYSQL -Ne "SELECT COUNT(1), MAX(id), MAX(name) FROM terminal"... (7 Replies)
Discussion started by: chebarbudo
7 Replies

9. UNIX for Dummies Questions & Answers

Set a variable from awk output

I have a file which I am processing using awk to spit out the following: export CLIENT=1 ; export USER=1 ; export METABASE=1 ; export TASK=1 ; export TOTAL=3 What i want to do now is execute that within the script so those variables are available to other commands. I've tried piping the... (3 Replies)
Discussion started by: Cranie
3 Replies

10. UNIX for Dummies Questions & Answers

Export command giving Variable Name vs the Value set for the Variable

I'm having an issue when I export within my program. I'm getting the variable name, not the variable value. I have a configuration file (config.txt) that has the values of the variables set as so: set -a export ARCHIVEPOSourceDir="/interfaces/po/log /interfaces/po/data" export... (2 Replies)
Discussion started by: ParNone
2 Replies
Login or Register to Ask a Question
mm(1)							      General Commands Manual							     mm(1)

NAME
mm, osdd - print documents formatted with the mm macros SYNOPSIS
[options] [files] [options] [files] DESCRIPTION
can be used to format and print documents using and the text-formatting macro package (see nroff(1)). It has options to specify prepro- cessing by and/or (see tbl(1) and neqn(1)), and postprocessing by various terminal-oriented output filters. The proper pipelines and the required arguments and flags for and are generated, depending on the options selected. is equivalent to the command Options recognizes the following options and command-line arguments. Any other arguments or options (such as are passed to or to as appropriate. Such options can occur in any order, but they must appear before the files arguments. If no arguments are given, prints a list of its options. Specifies the type of output terminal; for a list of recognized values for term, type If this option is used, uses the value of the shell variable from the envi- ronment (see profile(4) and environ(5)) as the value of term if is set; otherwise, uses as the value of term. If several terminal types are specified, the last one is used. Indicates that the document is to be produced in 12-pitch. Can be used when is set to one of and (The pitch switch on the DASI 300 and 300s terminals must be manually set to if this option is used.) Causes to invoke col(1); note that col(1) is invoked automatically by unless term is one of and Causes to invoke Causes to invoke Invokes the option of DIAGNOSTICS
sends the message if none of the arguments is a readable file and is not used as a filter. EXAMPLES
Assuming that the shell variable is set in the environment to the two command lines below are equivalent: reads the standard input when is specified instead of any file names (mentioning other files along with leads to disaster). This option allows to be used as a filter, as in this example: Hints o invokes with the option. With this option, assumes that the terminal has tabs set every 8 character positions. o Use the option of to specify ranges of pages to be output. Note, however, that if invoked with one or more of the and options, together with the option of may cause a harmless ``broken pipe'' diagnostic if the last page of the document is not specified in list. o If you use the option of (to stop between pages of output), use line-feed (rather than return or new-line) to restart the output. The option of does not work with the option of or if automatically invokes (see option above and col(1)). o If you specify an incorrect output terminal type, produces (often subtle) unpredictable results. However, if you are redirecting output into a file, use the option, then use the appropriate terminal filter when actually printing the formatted file. SEE ALSO
col(1), env(1), nroff(1), tbl(1), profile(4), term(4), mm(5). mm(1)