10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i have a variable that contains a list of files:
varA="/var/tmp/hello_0_myapp
/var/tmp/mello_1_myapp
/var/tmp/jello_2_myapp
/var/tmp/fello_3_myapp"
And i'm calling this variable in several functions:
col0 () {
FILE=$(echo "${varA}" | egrep "_0_myapp" | sed "s~_0_myapp~~g")... (5 Replies)
Discussion started by: SkySmart
5 Replies
2. Shell Programming and Scripting
pcmpath query device |awk 'BEGIN{print "DEVICE NAME\tSERIAL"} /DEVICE NAME/ {printf "%s\t", $5; getline; print substr($2, length($2)-3)}'
This script returns output like below to pull out "DEVICE NAME SERIAL".
......
hdisk28 110B
hdisk29 1112
hdisk30 1115
hdisk31 1116
hdisk32 1128... (2 Replies)
Discussion started by: Daniel Gate
2 Replies
3. Shell Programming and Scripting
I am parsing file for the fields using awk command, first i check 26th field for two characters using substr function if it matches then using for loop on array i search 184th field for 4 chars if it matches then i print the required fields but on execution i get the error, please help...... (5 Replies)
Discussion started by: siramitsharma
5 Replies
4. Solaris
So I was patching a Solaris 10 U08 X86 X2200 box in preparation for an Oracle upgrade. Rebooted the box because the patches failed and the box will not boot successfully. I need to back up the zones on the 2 drives before going further. I pulled the drives and attempted to mount them on my Ubuntu... (0 Replies)
Discussion started by: LittleLebowski
0 Replies
5. Shell Programming and Scripting
Dear All,
I have a file with 1s and 0s with tab delimited file of approximately 535 lines and 1000 columns. I would like to print the lines, which are having 1s in it and i don't want to print the links with complete 0s. Is it possible to do the above one using awk with some looping.
Need... (2 Replies)
Discussion started by: Fredrick
2 Replies
6. Shell Programming and Scripting
hi
i was trying to optimize one script and i came across this problem .. i am putting some pseudo code here
$ >cat a.sh
ls | while read I
do
i=$(($i + 1))
done
echo "total no of files : "
$ >ksh a.sh
total no of files :
$ >bash a.sh
total no of files :
why is... (1 Reply)
Discussion started by: zedex
1 Replies
7. UNIX for Dummies Questions & Answers
I cut specific cell(row=2, column=1) in my excel file and created new file using following script.
awk -F"," 'NR ==2 {print $1}' file1.csv > file1_new.csv
awk -F"," 'NR ==2 {print $1}' file2.csv > file2_new.csv
and so on....
The problem is that I have thousand files and I have to... (4 Replies)
Discussion started by: yonhk
4 Replies
8. Shell Programming and Scripting
Can I use a file as the list in a for loop? I tried it like this:
workstation=( $(cat /home/me/file) )
for ws in $workstation
do
command
done
The contents of file are like:
abc
def
ghi
It only read the initial line.
Does each item have to be quoted? Do they have to all be... (11 Replies)
Discussion started by: earnstaf
11 Replies
9. UNIX for Dummies Questions & Answers
Good day every body,
Iv've been given a list of files and directory requested by the Auditor's. My problem is how do i list the file with the permission given and also save the file into text.file so that i can passed the result/oucome to them?? Thanks alot guys!! (2 Replies)
Discussion started by: gagasan_makmur
2 Replies
10. Shell Programming and Scripting
is it possible to run a while loop by comparing a variable with a list ?
taglist="<html> </html> <head> </head> <body> </body> <p> </p> <ul> </ul> <li> </li> <em> </em> <title> </title>"
read newtag
while ]
do
echo "Entry is not in list, please try again'
read newtag
done... (6 Replies)
Discussion started by: forever_49ers
6 Replies