10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Apply if condition (in column 3rd ) to all lines of tab delim which have same value in a particular column (in this case column2)
Input:
id1 Disease1 High
id2 Disease1 Medium
id3 Disease1 Low
id4 Disease2 Low
id5 Disease3 Medium
id6 Disease3 Low
***
Expected output
id1 Disease1 High... (3 Replies)
Discussion started by: Lini
3 Replies
2. Shell Programming and Scripting
OS : RHEL 6.8
Shell : bash
I want to remove all lines like below from the history output as it has password.
$ history | grep sqlplus
239 sqlplus jn_usr/dxc825#@10.5.12.106/OCSGPD
256 sqlplus osb_soa/KD1egM09@10.5.12.196/BSOAPRD
279 sqlplus jn_usr/dxc825#@10.80.16.219/OCSGPD... (5 Replies)
Discussion started by: John K
5 Replies
3. Shell Programming and Scripting
grep -Fxvf testdata.xls file_GTDA1.xls >file_GTDA.xls
SLS_COUNT=`grep 'GTDA_Dly_Sls' file_GTDA.xls |wc -l`
PMIX_COUNT=`grep 'GTDA_Dly_Pmix' file_GTDA.xls |wc -l`
if ; then
var1=`cat file_GTDA.xls|grep 'GTDA_Dly_Sls_'`
var4="|"
for i in $var1... (7 Replies)
Discussion started by: renuk
7 Replies
4. Shell Programming and Scripting
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
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 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
8. Shell Programming and Scripting
Hi all,
I have an requirement related to delim count. I want to remove the lines having less than or equal to 2 fields in a csv file. In other words, I want to retrieve the records having more than 2 fields.
I can do this using a loop with tr and wc -l command by parsing record by record.... (3 Replies)
Discussion started by: poova
3 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I am triying to make sure that there exists only one file with the pattern abc* in path /path/. This directory is having many huge files. If there is only one file then I have to take its complete name only to use furter in my script.
I am planning to do like this:
if ; then... (2 Replies)
Discussion started by: new_learner
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