Sponsored Content
Top Forums Shell Programming and Scripting Use cut output as variable piped awk command Post 303019140 by heyooo on Sunday 24th of June 2018 12:16:00 AM
Old 06-24-2018
Geez nevermind.

Geez nevermind. I thought the command was simple enough.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How can I cut output of command??

I am on a Linux system using bash shell. I only want to see the number in the Use% field as the output. #df -h / Filesystem Size Used Avail Use% Mounted on /dev/dasda1 2.3G 2.1G 51M 98% / !#/bin/bash df -h / | awk '{print $5}' | cut -c1-2 Us 98 How do... (2 Replies)
Discussion started by: darthur
2 Replies

2. Shell Programming and Scripting

storing output from echo & cut into variable

Hi All, Hope someone can advise here as I have been struggling to find a syntax that works here. I have tried a stack of combination I have seed in the forums but I think because I have needed to use "" and `` in the statments another method is found. I am reading in lines with the following... (1 Reply)
Discussion started by: nkwilliams
1 Replies

3. Shell Programming and Scripting

Output piped to case insensitive awk

I have an encrypted password file, and I've created a simple script to search the password file for a particular record. There are multiple lines per record, so I'm using a record delimiter. #!/bin/bash PATTERN=$1 openssl des3 -d -salt -in ~/docs/pass.des3 | awk '{ FS="\n" ; RS="*" }... (2 Replies)
Discussion started by: 0rac1e
2 Replies

4. Shell Programming and Scripting

Can't Output Piped Perl In-line command to a File

Hello, I'm pretty stumped, and I don't know why I am not able to redirect the output to the 'graphme' file with the command below in Fedora 18. tcpdump -l -n -t "tcp == 18" | perl -ane '($s,$j)=split(/,/,$F,2); print "$s\n";' > graphme In case you're wondering, I was following the example... (2 Replies)
Discussion started by: ConcealedKnight
2 Replies

5. UNIX for Dummies Questions & Answers

Finding the modified timestamp of files from the piped output of du command

Version Info +++++++++++++++ RHEL 5.4 Since ls command lists file sizes in Bytes which can be long I use du command like below. I have run the du command for the below files as shown below. But I want pipe this output to ls command just to see the modified timestamp for these files. ... (7 Replies)
Discussion started by: kraljic
7 Replies

6. Shell Programming and Scripting

Assinging output of cut command

Hi, I have the files in the following files in a folder 19996587342 19487656550 19534838736 And i need to get the first 6 characters from the abvoe files so i used the following script #!/bin/ksh for i in 19* do txt= `$i | cut -c -6` echo "$txt" done The error is at... (4 Replies)
Discussion started by: smile689
4 Replies

7. Shell Programming and Scripting

sed and cut command in variable

hi, i want to remove 12 and 13 column from psv files and dump them in new folder ls -ltr *GTDA_Dly_Pmix_*.psv>filename.xls var1=`cat filename.xls` for i in $var1 do var3=`echo "$i" |cut -d '|' -f12,13 |sort -u` sed -e 's/"|$var3"//g... (2 Replies)
Discussion started by: renuk
2 Replies

8. UNIX for Dummies Questions & Answers

Tcsh command for assigning output of awk to variable

Hi I have a text file with 2 values and I am trying to assign each value to a variable and then write those to text files. So if the textfile is data.txt with 2 values x and y I want to assign mean=x, and stdev=y and then write these out in text files alongwith the id ($id has already been... (6 Replies)
Discussion started by: violin
6 Replies

9. Shell Programming and Scripting

Storing command output in a variable and using cut/awk

Hi, My aim is to get the md5 hash of a file and store it in a variable. var1="md5sum file1" $var1 The above outputs fine but also contains the filename, so somthing like this 243ASsf25 file1 i just need to get the first part and put it into a variable. var1="md5sum file1"... (5 Replies)
Discussion started by: JustALol
5 Replies

10. UNIX for Beginners Questions & Answers

Results of ldapsearch piped to grep are cut off

ldapsearch -x -LLL -E pr=200/noprompt -h abc-loc.somecompany.com -D "account@somecompany.com" -w password -b "cn=groupname,ou=Resource,ou=groups,dc=abc,dc=somecompany,dc=com" | grep member Results are: member: CN=Hanson\, Joe,OU=End Users,OU=Accounts,DC=abc,DC=somecompany,DC=com member:... (3 Replies)
Discussion started by: who10
3 Replies
TBUF(3pub)																TBUF(3pub)

NAME
tbuf_create, tbuf_destroy, tbuf_copy, tbuf_cat, tbuf_length, tbuf_chars - manipulate text editor buffer SYNOPSIS
#include <publib.h> Tbuf *tbuf_create(const char *chars, size_t len); void tbuf_destroy(Tbuf *tbuf); Tbuf *tbuf_copy(Tbuf *tbuf, size_t offset, size_tlen); Tbuf *tbuf_cat(Tbuf *tbuf, Tbuf * tbuf); size_t tbuf_length(Tbuf *tbuf); void tbuf_chars(char *chars, Tbuf *tbuf, size_t offset, size_t len); DESCRIPTION
These routines create and manipulate simple text editor buffers, which can also be thought of as arbitrarily large text strings. The buf- fers are one-dimensional (i.e., not automatically divided into lines), and are indexed with character offsets. They are 8-bit and binary clean, i.e., they may contain any 8-bit characters, including the zero byte (''). tbuf_create creates a buffer from a C character array, and tbuf_destroy destroys it. Once it's created, a buffer may not be modified. Instead, a new buffer needs to be created, using tbuf_cat and tbuf_copy. They create the new buffer so that it shares as much memory as possible with the old buffer, so the immutability does not necessarily waste memory much. By never changing a buffer, it is rather simple to implement undo and redo: you only need to keep a list of buffers and display the suitable one to the user. The caller should remember to call tbuf_destroy for unnecessary buffers, of course. tbuf_length returns the number of characters in the buffer. tbuf_copy copies part of a buffer into a C character array. The array is not zero-terminated; the caller must do it himself. RETURN VALUE
tbuf_create, tbuf_copy, and tbuf_cat return a pointer to the new buffer, or NULL if the operation failed. tbuf_length returns the number of characters in the buffer. tbuf_destroy and tbuf_chars return nothing and cannot fail. SEE ALSO
publib(3), sbuf(3) AUTHOR
Lars Wirzenius, liw@iki.fi. TBUF(3pub)
All times are GMT -4. The time now is 07:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy