10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have simple test.sh script, see below:
bill_code=`echo $record | awk -F"|" '{print $1}'`
Fullname=`echo $record | awk -F"|" '{print $3}'`
email=`echo $record | awk -F\ '{print $4}'`
The last field contains spaces: see csv below:
A0222|Y|DELACRUZ|-cc dell@yahoo.com-cc support@yahoo.com
... (9 Replies)
Discussion started by: quay
9 Replies
2. UNIX for Dummies Questions & Answers
Hi,
Anyone can help me on how to list the file with spaces? Like I want to "ls" only the 2008 files.
2008 _overview102.jpg
2008 _overview103.jpg
2008 _overview106.jpg
2008 _overview677.jpg
2008 _overview680.jpg
2008 _overview110.jpg
2008 _overview682.jpg
2009 _overview4373.jpg
2009... (1 Reply)
Discussion started by: fspalero
1 Replies
3. Shell Programming and Scripting
So, here's a scenario that requires the same logic as what I'm working on: Suppose that you have a directory containing files named after users. For awk's purposes, the filename is a single field-- something parse-friendly, like john_smith. Now, let's say that I'd like to populate an array in... (2 Replies)
Discussion started by: treesloth
2 Replies
4. Shell Programming and Scripting
I'm trying to run a Linux virus scan on a list of files/folders I have ported to list.txt in a format:
some file with spaces
some other file
but I need to feed my scanning script in the format:
some\ file\ with\ spaces/
some\ other\ file/
so I would like to read in list.txt and output... (6 Replies)
Discussion started by: unclecameron
6 Replies
5. Shell Programming and Scripting
Guys,
I need to iterate populate an array while going over files in directory. Can someone please tell me syntax I tried this but it isn't working ==>
for F in `ls -p "${directory1}" | grep -v "\/"`
do
cd "${directory2}"
cmp "${directory2}"/"${F}" "${directory1}"/"${F}" ... (2 Replies)
Discussion started by: Veenak15
2 Replies
6. Shell Programming and Scripting
Hi,
The following test case populate an array named: array3.
Since array1 and array2 are equal in length and values array3 will remain empty.
#!/usr/bin/ksh
test() {
set -A array1 "A"
set -A array2 "A"
NUM_1=`echo ${#array1}`
print "num elenemt in NUM_1 is ${NUM_1}"
i=1
for ELE2 in... (1 Reply)
Discussion started by: yoavbe
1 Replies
7. Shell Programming and Scripting
Hi.
I have a file with the following structer:
DB DISK LOCATION SIZE
============================================
PROD DATA_01 /dev/dm-23 10
PROD DATA_02 /dev/dm-24 10
PROD DATA_03 /dev/dm-25 10
DEV DATA_04 /dev/dm-26 10
DEV DATA_05 ... (1 Reply)
Discussion started by: yoavbe
1 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
I have a script that reads a file and echo it back to std out.
Test.txt
1aaaaaaaaaaa .
The script is ReadLine.sh
#!/bin/ksh
cat $1 | while read file
do
echo $file
done
I invoke the script as ReadLine.sh Test.txt
The output that I get is (1 Reply)
Discussion started by: aksarben
1 Replies
9. Shell Programming and Scripting
I need to tweek my awk output:
#cat filename
ab cd ef:ghi:jk lm:nop qrs
#cat filename | awk '{ for(i=3;i<NF+1;i++) printf $i}'
ef:ghi:jklm:nopqrs
I would like the ouput to include the original spaces from columns 3 on:
ef:ghi:jk lm:nop qrs
any suggestions? (4 Replies)
Discussion started by: prkfriryce
4 Replies
10. Shell Programming and Scripting
I am accessing two files. I am using read command to read from the files.
For the first file, I need read the fields delimited by spaces, and for the other file, I need to read the whole line as a single field including the spaces.
When I used read command for the second file, the spaces... (4 Replies)
Discussion started by: kumariak
4 Replies