03-05-2009
Can any one explain what this code will do
ccc_con,CCC_CON,0
Above is the input for this code
#!/usr/bin/bash
my_path=`dirname $0`
T_table=$1
S_table=$2
P_table=$3
#Star new code
while read ${my_path}/arch_table_list.txt
{
awk -F "," '{print $1}' ${my_path}/arch_table_list.txt ${S_table}
awk -F "," '{print $2}' ${my_path}/arch_table_list.txt ${T_table}
awk -F "," '{print $3}' ${my_path}/arch_table_list.txt ${P_table}
}
echo $S_table $T_table $P_table
Can anyone explain me this script
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hey peeps
could someone explain what this part of the code means:
'if echo $* | grep -q' $i '||
thanks
tHe_nEw_GuY (2 Replies)
Discussion started by: the_new_guy
2 Replies
2. UNIX for Advanced & Expert Users
Hi ,
Can anyone explains what does the below highlighted statements means:
# Set environment variables
. ${0%/*}/wrkenv.sh
jobName_sh=${0##*/}
jobName=${jobName_sh%.*}
Thanks,
Sri (1 Reply)
Discussion started by: srilaxmi
1 Replies
3. Shell Programming and Scripting
while getopts :g:l:h: KEY $*
do
case $KEY
in
g) NAME=$OPTARG ;;
l) LAB=$OPTARG ;;
h) HD=$OPTARG ;;
*) echo "Illegal option: $OPTARG"
echo "$usage"
exitStatus=1
exitGrace
esac
done (2 Replies)
Discussion started by: santosh1234
2 Replies
4. Programming
Hi, I have this block in a code and I need to know it's meaning:
bool selectEvents = config.get("selectEvents",false);
if (selectEvents) {
ifstream in("events");
while (in) {
int run, evt;
in >> run >> evt;
if (in.eof()) break;
... (5 Replies)
Discussion started by: eager2no
5 Replies
5. Shell Programming and Scripting
Hi,
Can anyone pls explain me the below SED code in detail.
sed -e :a -e '$!N;s/\n//;ta' -e P -e D
When this code is executed with a file(has 1lac records), it is taking very long time to process.
So I wanted to modify this SED code with equivalant AWK code.
Thanks,
Sri (1 Reply)
Discussion started by: srilaxmi
1 Replies
6. Shell Programming and Scripting
I have something like in the script. Can anyone explain what does the sort command does and followed by the sed
sort -r -k3.7,3 -k3.1,3 -k3.4,3 -t: $dir"abc_"$x"_parsed" | sed -e 's/\(\)\(\{3\}\)/\1,\2/2' -e 's/\/2,00/\/200/'
The file abc_"$x"_parsed contains something like below
... (7 Replies)
Discussion started by: Muthuraj K
7 Replies
7. Shell Programming and Scripting
Hi,
Pls explain me what the below code is doing. specially meaning if -a while calling test function-
case $1 in
1) beg_dt=01; end_dt=07 ;;
2) beg_dt=08; end_dt=14 ;;
3) beg_dt=15; end_dt=21 ;;
4) beg_dt=22; end_dt=28 ;;
5) beg_dt=29; end_dt=31 ;;
esac test \( `date +%w` -eq $2 -a... (3 Replies)
Discussion started by: sendtoshailesh
3 Replies
8. Shell Programming and Scripting
Hi i am new to shell script can any one please explain me the code below which is written for execution of python scripts which are located in same folder.
please explain the code line by line
ls *.py > xx
while
do
read myline || break
python $myline
done<xx
Thanks
Mukthyar.... (1 Reply)
Discussion started by: mukthar1255
1 Replies
9. Shell Programming and Scripting
Hi Guys,
Please help me, I am new to programming and I don’t understand what some parts of this code are doing. I have comments on the parts I know, please help if my understanding of the code is not correct and also help with parts with questions.
awk '
{
gsub( ">",... (1 Reply)
Discussion started by: James_Owen
1 Replies
10. Shell Programming and Scripting
can anyone please explain this code?
sed ':a;N;$!ba;s/]\n//g' file
it replaces lines ending with "]" and concatenates with the next line so that
line1]
line2
becomes
line1line2
i don't understand this part: :a;N;$!ba;
I have noted that I can replace "a" with any letter:
... (1 Reply)
Discussion started by: locoroco
1 Replies
LEARN ABOUT SUNOS
endusershell
getusershell(3C) Standard C Library Functions getusershell(3C)
NAME
getusershell, setusershell, endusershell - get legal user shells
SYNOPSIS
#include <unistd.h>
char *getusershell(void);
void setusershell(void);
void endusershell(void);
DESCRIPTION
The getusershell() function returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If
/etc/shells does not exist, the following locations of the standard system shells are used in its place:
/bin/bash /bin/csh
/bin/jsh /bin/ksh
/bin/pfcsh /bin/pfksh
/bin/pfsh /bin/sh
/bin/tcsh /bin/zsh
/sbin/jsh /sbin/pfsh
/sbin/sh /usr/bin/bash
/usr/bin/csh /usr/bin/jsh
/usr/bin/ksh /usr/bin/pfcsh
/usr/bin/pfksh /usr/bin/pfsh
/usr/bin/sh /usr/bin/tcsh
/usr/bin/zsh /usr/xpg4/bin/sh
The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells.
The setusershell() function rewinds the file or the list.
The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells.
RETURN VALUES
The getusershell() function returns a null pointer on EOF.
BUGS
All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved.
SunOS 5.10 30 Aug 2004 getusershell(3C)