10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I would like use the output of my cut command as a variable in my following awk command. Here's what I've written.
cut -f1 info.txt | awk -v i=xargs -F'' '{if($6 == $i) print $20}' summary.txt
Where obviously the 'xargs' doesn't do what I want. How can I pass my cut result to my awk... (3 Replies)
Discussion started by: heyooo
3 Replies
2. UNIX for Beginners Questions & Answers
I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I'm using cygwin on my Windows 7 machine.
From the man pages of cut:
--output-delimiter=STRING
use STRING as the output delimiter the default is to use the input delimiter
I tried the following commands and got the error messages:
$ cut -c1-10,20-30 -d... (10 Replies)
Discussion started by: kojac
10 Replies
4. Shell Programming and Scripting
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
5. UNIX for Dummies Questions & Answers
I can not make it work, it prints \t rather than introduce tabs.
cut -d "," -f 4,8 Samples.csv --output-delimiter="\t" | sort > out
Since I am running this command within a shell script, I tried manually inserting tab in this command, still does not work. I am using bash shell
Suggestions... (8 Replies)
Discussion started by: analyst
8 Replies
6. Shell Programming and Scripting
hello,
i use following command:
md5sum TEST.xml
the output looks like:
900hjidur84hjr938ikv TEST.xml
as you can see, the first part is the md5 code, the second part is the file name, but i only want the first part(md5 code), and save it to a file, how to do that? thanks. (2 Replies)
Discussion started by: zbc
2 Replies
7. Shell Programming and Scripting
Hi
Can anyone what I am doing wrong while using cut command.
for f in *.log
do
logfilename=$f
Log "Log file Name: $logfilename"
logfile1=`basename $logfilename .log`
flength=${#logfile1}
Log "file length $flength"
from_length=$(($flength - 15))
Log "from... (2 Replies)
Discussion started by: dgmm
2 Replies
8. Shell Programming and Scripting
Hi guys,
I need to cut the first 12 system processes from the command ps -A. I know that the cut command forms part of the pipeline but can't understand how to cut the first 12 lines and later display them on standard output. Please help!
Many thanks, Jared. (3 Replies)
Discussion started by: jjb1989
3 Replies
9. Shell Programming and Scripting
Hi all
i am writing a shell , which will get input from the user and then try to change the CASE to lower
echo "Please enter the unix server name ::"
read unix1
unix 2 =tr '' '' < $unix1
echo $unix2
its not giving me the result in lower case..
User input will be in Upper case and... (2 Replies)
Discussion started by: raghav1982
2 Replies
10. UNIX for Dummies Questions & Answers
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