9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I found this in a script and I would like to know how this works
Code is here:
# var1=PART1_PART2
# var2=${var1##*_}
# echo $var2
PART2
I'm wondering how ##* makes the Shell to understand to pick up the last value from the given. (2 Replies)
Discussion started by: sathyaonnuix
2 Replies
2. Shell Programming and Scripting
Hi,
can some one suggest me,how "sed" is managed to delete the second field here.
Any explanation on , how the below code is working would be appreciated.
sed 's/^\(*\)::/\1::/' /etc/passwd
sed 's/*:/:/2' /etc/passwd (14 Replies)
Discussion started by: panyam
14 Replies
3. UNIX for Dummies Questions & Answers
Hi
cat /etc/group :
....
oinstall:x:401:
dba:x:400:oracle
...
cat /etc/passwd|grep oracle
oracle:x:130:401::/home/oracle:/bin/ksh
1. Is that mean that :
ORACLE user has OINSTALL as it Primary group and DBA as secondary group ?
2. What is the linux comman to set ORACLE user with... (2 Replies)
Discussion started by: yoavbe
2 Replies
4. Solaris
I want to know how can in Solaris i can:
>Set Process priority to maximum
>Set Process Affinity.
Linke in windows task manager we can set process priority to following levels:
Low, Below Normal,Normal , Above Normal , High , Realtime
And we can set process affinity to run on all processors.... (10 Replies)
Discussion started by: mr_os
10 Replies
5. UNIX for Dummies Questions & Answers
Hi Gurus:
I am trying to understand the following line of code.I did enough of googling to understand but no luck.Please help me understand the follow chunk of code:
X=$0
MOD=${X%/*}/env.ksh
X is the current script from which I am trying to execute.
Say if X=test.ksh
$MOD is echoing :... (3 Replies)
Discussion started by: vemana
3 Replies
6. Shell Programming and Scripting
I just started shell coding and I'm a bit confused on how 'mv' works can someone explain to me how it works and if i did this correctly. Thanks.
echo "Enter Name of the first file:"
read file1
#echo $file1
if ; then
echo "Sorry, file does not exist."
exit 1
... (16 Replies)
Discussion started by: taiL
16 Replies
7. Shell Programming and Scripting
I was reading Bash Cookbook and it had a line of command that assigned a value from var2 to var1 if var1 was empty. Someone told me I could do the same with ${parameter}.
I'm just trying to understand this. Would the following be correct?
For:
answer=
default=1Should I assume that the two... (1 Reply)
Discussion started by: victorbrca
1 Replies
8. Shell Programming and Scripting
In our old code, we have the below statements
LAST_FRIDAY=2009-01-16
echo $LAST_FRIDAY|cut -d '"' -f2
And the output of this is 2009-01-16
The delimiter provided in cut statement is not used in the variable. Also, when we give f1 or f3 or f10 or any other field instead of f2, we still... (3 Replies)
Discussion started by: krishmaths
3 Replies
9. UNIX for Advanced & Expert Users
hi,
by getpid() i will get the pid of the current process.
but how do get the name of this process...
or instead from pid how do i get process name...
is there any way...
thanks in advance.... (2 Replies)
Discussion started by: vishallbansal
2 Replies