Sponsored Content
Full Discussion: awk using ssh variable?
Top Forums Shell Programming and Scripting awk using ssh variable? Post 302221416 by danmero on Monday 4th of August 2008 12:07:48 PM
Old 08-04-2008
Code:
awk '{
a[$0]++                               #read each line($0) from source file in array a and count ++ occurrences of $0
}
END                                   #at the end of file do..
{
for (i in a)                          #for each member (i)of array a
printf "%s\t%s %s\n",i,a[i],"Atoms"   #format the output, read man printf for more options
}
' file > new_file                     #declare the source file and set the output (>) to new_file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issue in Variable in SSH

Friends, I want to write a script. The logic follows 1. Script starts 2. SSH to Remote Machine and check whether /home/testUser dir is there or not. 3. If it is there, am assigning a value to a variable. else not 4. If the variable is set, the do the copy from remote machine to my local... (2 Replies)
Discussion started by: balamv
2 Replies

2. Shell Programming and Scripting

setting a variable, using SSH and awk?

hi there I am trying to get a value from a remote machine into a local variable. To get this value i want to use awk but im having trouble getting it to run, am i escaping in the right places here and using the right quotes (i must have tried a million combinations :() # VAR=`ssh server1... (5 Replies)
Discussion started by: hcclnoodles
5 Replies

3. Shell Programming and Scripting

assign awk's variable to shell script's variable?

Dear All, we have a command output which looks like : Total 200 queues in 30000 Kbytes and we're going to get "200" and "30000" for further process. currently, i'm using : numA=echo $OUTPUT | awk '{print $2}' numB=echo $OUTPUT | awk '{print $5}' my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies

4. Shell Programming and Scripting

Variable value in ssh

Hi, I'm creating a script where I connet to a remote machine, I execute a command (I get a pid of an application) and I kill the application. I wrote this: ssh $HOST_WHITEBOARD<<END COMMAND_GET_PID_WHITE="ps aux | grep something | awk '/Sl+/ {print \$2}' | awk 'begin {row=0} row==0... (4 Replies)
Discussion started by: abdujaparov
4 Replies

5. Shell Programming and Scripting

use awk to ssh from variable in flat file

flat file looks like ooss-pfgg-1234,vol_name_1, mail-list decoded = hostname,volum_name,mail_list each line has diff info am trying to ssh into each fist field, check vol usage for second field, and if greater than 90% send mail to mail-list got the second and third part working, ... (1 Reply)
Discussion started by: riegersteve
1 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

help about the ssh accpect a variable

# dir=/mnt # ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@10.0.2.3 'cd $dir;ls' The $dir doesn't take effect any help?? ( I want use variable to do something Thanks in advance (1 Reply)
Discussion started by: yanglei_fage
1 Replies

8. Shell Programming and Scripting

how to assign value to the variable through ssh

Hi All, i am writing a shellscript to compare cksum of the file in local machine and after copying to remote machine. i am not able to assign command output value to variable in remote machine through SSH. PFB code for this. code: ###### Get File size of the file in local remote system ... (3 Replies)
Discussion started by: katamsivakumar
3 Replies

9. Shell Programming and Scripting

Passing a variable via ssh, can't quite get it right

Hi Guys n Girls, Below im using a while command to wait for a file on another server then carrying on with the script..... I dont believe the $Sausage1 variable is being passed to the other server so its not finding the file. If i replace the variable with the date then it works as expected. ... (2 Replies)
Discussion started by: twinion
2 Replies

10. UNIX for Beginners Questions & Answers

How can I assign awk's variable to shell script's variable?

I have the following script, and I want to assign the output ($10 and $5) from awk to N and L: grdinfo data.grd | awk '{print $10,$5}'| read N L output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 03:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy