Search Results

Search: Posts Made By: adshocker
2,235
Posted By balajesuri
%% tells the shell to start looking for the last...
%% tells the shell to start looking for the last occurrence of '/' from the end of string and strip off everything (*) from there till the end (this is done by \/*). The last occurrence of '/' from...
2,235
Posted By balajesuri
host=${parm1%%\/*} location=${parm1#*\/}
host=${parm1%%\/*}
location=${parm1#*\/}
6,708
Posted By harish612
try with below code list=`ls *.sh` echo...
try with below code

list=`ls *.sh`
echo $list | tr -s '\040' '\012'


Cheers
Harish
6,708
Posted By Scott
Quoting "$LIST" will preserve the ls output...
Quoting "$LIST" will preserve the ls output format:


echo "$LIST"
You could just as easily use ls *.sql, than using grep (except possibly when a very, very large number of files is involved).
4,051
Posted By Ygor
Try...shopt -s extglob ls !(*.*) *.prog
Try...shopt -s extglob
ls !(*.*) *.prog
1,551
Posted By Skrynesaver
man getoptsRunning the following #!...
man getoptsRunning the following

#! /bin/bash
while getopts "abc:n" opt; do
case $opt in
a ) a="true";;
b ) b="true";;
c ) c=$OPTARG;;
n...
1,551
Posted By kshji
If not set File, it's nothing => test give error,...
If not set File, it's nothing => test give error, need argument

File=""
#...
if [ -f "$File" ]


# maybe better testing: File has value and file exist
if [ "$File" != "" -a -f "$File" ]
9,018
Posted By clx
Ok..Sorry I didn't see your explanation clearly. ...
Ok..Sorry I didn't see your explanation clearly.
in that case you could change the IFS to '"' then set.

something like..

IFS='"'
set -- $@
echo "TO=$1"
echo "CC=$2"
echo "BCC=$3"

...
2,186
Posted By zaxxon
Creating an archive with tar and then compressing...
Creating an archive with tar and then compressing it with another tool like gzip, bzip2, .... is the usual way, yes.

Though there was similar questions already with a solution:...
2,686
Posted By Ygor
Try...set -- $my_row USER_ID=$1 USERNAME=$2
Try...set -- $my_row
USER_ID=$1
USERNAME=$2
2,686
Posted By michaelrozar17
Is this the one you need..? USER_ID=$(echo...
Is this the one you need..?
USER_ID=$(echo $my_row | awk '{print $1}' )
USERNAME =$(echo $my_row | awk '{print $2}' )
5,780
Posted By m.d.ludwig
You need an empty line to end the MIME header....
You need an empty line to end the MIME header. Also, uuencode is not quite the same as base64. My suggested changes are in red, below:
14,185
Posted By clx
The above is working for me. May be your bourne...
The above is working for me.
May be your bourne shell is older? There is nothing to do with ksh (the shebang) here since you are invoking script with command line shell. (sh)

try invoking with...
2,621
Posted By cfajohnson
Do you really only want to count files whose...
Do you really only want to count files whose names contain a dot?



Don't use ls. The shell will expand the wildcard:


num_files()
{
[ -e "$1" ] && num_files=$# || num_files=0
}
...
3,385
Posted By Chubler_XL
To determine shell: $ ps -p$$ If...
To determine shell:

$ ps -p$$

If other than AR_ this should work too:

SOURCE=`echo $file | sed "s/^[^_]*_//;s/_.*//"`
1,671
Posted By michaelrozar17
[^0-9] - means there should be no numbers between...
[^0-9] - means there should be no numbers between 0 to 9 appear before and after your filename (570345)
1,671
Posted By frans
egrep: F=570345 echo *${F}* | grep -E...
egrep:
F=570345
echo *${F}* | grep -E '[^0-9]$F[^0-9]'
# ls *${F}* | grep -E '[^0-9]$F[^0-9]' # If the previous doesn't work
1,671
Posted By sanjay.login
the second code is good. coz in first it...
the second code is good.

coz in first it will not show the desied result though those three file are a single line representation.
but the ls *${F}* is a three line representation of those three...
1,671
Posted By rdcwayx
ls *[^0-9]570345[^0-9]*
ls *[^0-9]570345[^0-9]*
Showing results 1 to 19 of 19

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