10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have this filename "RBD_EXTRACT_a3468_d20131118.tar.gz" and I would like print out the "yyyymmdd" only. I use this command below, but if different command like cut or print....etc. Thanks
ls RBD_EXTRACT* | sed 's/.*\(........\).tar.gz$/\1/' > test.txt (9 Replies)
Discussion started by: dotran
9 Replies
2. Shell Programming and Scripting
Hi,
Can anyone let me know what is difference between
grep .* foo.c
grep '.*' foo.c
I am not able to understand what is exact difference.
Thanks in advance (2 Replies)
Discussion started by: SasDutta
2 Replies
3. Shell Programming and Scripting
Hi,
using awk command I want to print filenames and the last line of each file, in a single command line statement.
I want to use 'awk', because I want to add more functionality to this logic later.
I tried the following on *.sh files in the current directory
find . -type f -name "*.sh"... (26 Replies)
Discussion started by: ysrini
26 Replies
4. Shell Programming and Scripting
I can got the filename with this script. it's only show "-" in result.
cut -d , -f7 CSV_d.* | awk 'OFS=":"{print FILENAME,substr($1,1,8),substr($1,9,2),substr($1,11,2),substr($1,13,2)}' | sort |uniq (2 Replies)
Discussion started by: before4
2 Replies
5. UNIX for Dummies Questions & Answers
uname -a
SunOS mypc 5.10 Generic_141414-07 sun4v sparc SUNW,SPARC-Enterprise-T2000
uname -a
SunOS mypc 5.10 Generic_144488-07 sun4v sparc SUNW,SPARC-Enterprise-T5220
find . -name "*.cer" -exec keytool -v -list -printcert -file {} \; | grep -i "Aug 03"
Valid from: Mon Jan 29 00:00:00 GMT... (16 Replies)
Discussion started by: shifahim
16 Replies
6. Shell Programming and Scripting
I'm trying to clean up my samba share and need to print the found file or print the path of the image it tried to searched for. So far I have this but can't seem to get the logic right. Can anyone help point me in the right direction?
for FILE in `cat list`; do
if ;
then
... (1 Reply)
Discussion started by: overkill
1 Replies
7. Shell Programming and Scripting
Im want to print filename inside loop .. the code im using :-
Filename_1=abc_20090623_2.csv.lk
Filename_2=def_20090623_2.csv.lk
i want to extract filename till .csv eg
Filename_1=abc_20090623_2
Filename_2=def_20090623_2
How can i do this inside the for loop
... (3 Replies)
Discussion started by: r_t_1601
3 Replies
8. Shell Programming and Scripting
#!/bin/ksh
for files in `ls *.gz`
do
gunzip -c $files | awk -v s=$files -F\" '{print s","$6}'
done
I have tried FILENAME parameter but it did not work please help. (1 Reply)
Discussion started by: harshakirans
1 Replies
9. AIX
I need help to split a filename 'a0crk_user:A0-B0123$#%test' into a0crk_user and A0-B0123 and print the output under 2 different columns namely
User and Status.
for eg. the output should like below:
User Status
---- ------
a0crk_user A0-B0123 (3 Replies)
Discussion started by: mbak
3 Replies
10. Shell Programming and Scripting
Hi Guys,
I need to set the value of $7 to zero in case $7 is NULL. I've tried the below command but doesn't work. Any ideas. thanks guys.
MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else { print $7}}' `
Harby. (4 Replies)
Discussion started by: hariza
4 Replies