Sponsored Content
Top Forums Shell Programming and Scripting rediret output to variable... Post 302368855 by Reddy482 on Thursday 5th of November 2009 08:15:05 PM
Old 11-05-2009
rediret output to variable...

Hi i have a problem in redirecting the ouput to a variable.I want to use that variable in the script itself.

here is my problem...

unique.out "UNIX" | grep Encrypted | awk '{FS=" "} {print $2}' .

unique.out is and executable file that generates uniqe id WITH THE FOLLOWING FORMAT.
Using Key .....
Trying to Encrypt UNIX ......
Uniqe Code: 123232312434, lenght 32"

AND also i not able to take out of that coma( ,)from the uniqeid. please help me to remove that comma from the output and put that output in a varaible.


please help me on this issue.
Thanks in advance...
.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Command output to a variable.

With cut -c 8-13 myfile, I am getting some numeric value. In my shell script I am trying to assign something like this, var=cut -c 8-13 myfile But at the time of execution I am getting -c is not found. If I dont assign, then script executes well. Can we not simply use the value from one... (8 Replies)
Discussion started by: videsh77
8 Replies

2. Shell Programming and Scripting

sql output into a variable

i have to do a check in my UNIX script to see whats saved in the database. depending on whats there will fork data to certain functions. However i do not know how to capture SQL output into a UNIX variable. Below is what i have tried, but i get an error: Error 3706 Failure 3706 Syntax error:... (3 Replies)
Discussion started by: purplebirky
3 Replies

3. Shell Programming and Scripting

ls wildcard output to a variable

I am new to shell programming, i have a requierement to assign a file name into a variable. for ex: the file name are below 603_2009_09_24_34.csv 702_2009_10_25_10.csv for ex: i need to get the file 603_2009_09_24_34.csv but first 3 didgits are fixed but rest of the digits are not below is... (3 Replies)
Discussion started by: Devendar
3 Replies

4. Shell Programming and Scripting

Save output in a variable

Hi, I have a 3rd party tool on Solaris 8. I am running it thorugh my script but I am not able to capture its output into a variable. Like, I tried, but did not work. output=`/usr/bin/myTool` echo $output Also, I tried saving in a file but when I run, output is always shown on the... (19 Replies)
Discussion started by: angshuman_ag
19 Replies

5. UNIX for Dummies Questions & Answers

Output into a Variable

i was wondering is there anyway to take the output of a command and put it into a variable?? what i need to to is only take a certain part of the output that lies between <"data needed "> ---------- Post updated at 09:39 PM ---------- Previous update was at 09:38 PM ---------- and place... (6 Replies)
Discussion started by: jmorey
6 Replies

6. Shell Programming and Scripting

using awk for setting variable but change the output of this variable within awk

Hi all, Hope someone can help me out here. I have this BASH script (see below) My problem lies with the variable path. The output of the command find will give me several fields. The 9th field is the path. I want to captured that and the I want to filter this to a specific level. The... (6 Replies)
Discussion started by: Cowardly
6 Replies

7. Shell Programming and Scripting

Output to shell variable

head -n 1 ~/.fvwm/config | grep -c "some-string" It's the output from grep I need to put into a shell variable. Also - I appreciate tips for other commands giving the same output. (2 Replies)
Discussion started by: Swepter
2 Replies

8. Shell Programming and Scripting

Use while loop - output variable

I'm very much a newbie and hence why this is going to be a stupid question. I'm attempting to create a korn shell script that pulls zone file locations and includes the copy command in the output. What? getzonedir.ksh #!/bin/ksh while read -r domain do ls */*"$domain" > $dir1 echo "cp... (5 Replies)
Discussion started by: djzah
5 Replies

9. Shell Programming and Scripting

Why output nothing to variable?

root@SDP_Gaming_Socketed_GT3-1:/# rngd -r /dev/urandom -v Available entropy sources: Intel/AMD hardware rng DRNG root@SDP_Gaming_Socketed_GT3-1:/# x=`rngd -r /dev/urandom -v` root@SDP_Gaming_Socketed_GT3-1:/# echo "$x" #get nothing root@SDP_Gaming_Socketed_GT3-1:/# x=`eval rngd -r... (6 Replies)
Discussion started by: yanglei_fage
6 Replies

10. UNIX for Advanced & Expert Users

Passing variable as input & storing output in other variable

I have a below syntax its working fine... var12=$(ps -ef | grep apache | awk '{print $2,$4}') Im getting expected output as below: printf "%b\n" "${VAR12}" dell 123 dell 456 dell 457 Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
SPLIT(1)							   User Commands							  SPLIT(1)

NAME
split - split a file into pieces SYNOPSIS
split [OPTION]... [INPUT [PREFIX]] DESCRIPTION
Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is `x'. With no INPUT, or when INPUT is -, read standard input. Mandatory arguments to long options are mandatory for short options too. -a, --suffix-length=N use suffixes of length N (default 2) -b, --bytes=SIZE put SIZE bytes per output file -C, --line-bytes=SIZE put at most SIZE bytes of lines per output file -d, --numeric-suffixes use numeric suffixes instead of alphabetic -l, --lines=NUMBER put NUMBER lines per output file --verbose print a diagnostic just before each output file is opened --help display this help and exit --version output version information and exit SIZE may be (or may be an integer optionally followed by) one of following: KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y. AUTHOR
Written by Torbjorn Granlund and Richard M. Stallman. REPORTING BUGS
Report split bugs to bug-coreutils@gnu.org GNU coreutils home page: <http://www.gnu.org/software/coreutils/> General help using GNU software: <http://www.gnu.org/gethelp/> Report split translation bugs to <http://translationproject.org/team/> COPYRIGHT
Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
The full documentation for split is maintained as a Texinfo manual. If the info and split programs are properly installed at your site, the command info coreutils 'split invocation' should give you access to the complete manual. GNU coreutils 8.5 February 2011 SPLIT(1)
All times are GMT -4. The time now is 02:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy