Search Results

Search: Posts Made By: ccwq
3,239
Posted By ccwq
Genius! Thanks for helping It works now.
Genius!
Thanks for helping
It works now.
3,239
Posted By ccwq
#!/bin/bash . ${HOME}/.std_dbrc cd...
#!/bin/bash

. ${HOME}/.std_dbrc
cd $STD_DBROOT
studentNo=$1
tmp=/tmp/acc2courses$ID.$$

grep -w "$studentNo" CSE1001 >/dev/null 2>&1
[ $? -eq 0 ] && tmpString=CSE1001
grep -w "$studentNo"...
3,239
Posted By ccwq
awk '/^[1-9]/{print ""} {gsub("\"", "") ...
awk '/^[1-9]/{print ""}
{gsub("\"", "")
printf"%s,", $0}
END{print ""}' <<EOF | sed 's/,$//'
1,ad,"adc
sdfd",edf
2,asd,"def
fde",asd
EOF

1,ad,adc,sdfd,edf
2,asd,def,fde,asd

This is the...
3,239
Posted By ccwq
But sometime it may has CSE9001 only. or CSE1002 ...
But sometime it may has CSE9001 only. or CSE1002

Here is
tomoo@Tomoo:~$ bash std_db_acc2courses cs123456
std_db_acc2courses: line 15: CSE1002: command not found
std_db_acc2courses: line 17:...
3,239
Posted By ccwq
thanks for replying, I still can't get it work,...
thanks for replying, I still can't get it work, is there any AWK way to solve the problem?
3,239
Posted By ccwq
should be like CSE1001, CSE1002, CSE9001 while...
should be like CSE1001, CSE1002, CSE9001
while read w1
do
read w2
read w3
echo ${w1}${w2}${w3}
done < $tmp

but It doesn't work with only 1 or 2 words, it will be like CSE1001, CSE1002,...
3,239
Posted By ccwq
CSV format problem
studentNo=$1
tmp=/tmp/acc2courses$ID.$$
grep -w "$studentNo" CSE1001 >/dev/null 2>&1
[ $? -eq 0 ] && echo CSE1001 >>$tmp
grep -w "$studentNo" CSE1002 >/dev/null 2>&1
[ $? -eq 0 ] && echo CSE1002...
7,603
Posted By ccwq
Frequently Asked Questions for Assgn 3. What...
Frequently Asked Questions for Assgn 3.
What does the .std_dbrc file contain?
Something like:

STD_DBROOT=${HOME}/class/2031/Assgn3/STD_DB

You do not submit this file, I will be using mine...
7,603
Posted By ccwq
Something about my assignment
1. Student Database
In this assignment you will design a simple file based database. All the files are in
the simplest form of CSV (Comma Separated Values) where every pair of adjacent fields
are...
7,603
Posted By ccwq
Post Shell programming: Question about source a file and read data from the file
This is shell programming assignment.
It needs to create a file called .std_dbrc contains
STD_DBROOT=${HOME}/class/2031/Assgn3/STD_DB
(which includes all my simple database files)

and I am...
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 01:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy