Search Results

Search: Posts Made By: lalitpct
13,538
Posted By guruprasadpr
Hi mkdir -p a/b/c Guru.
Hi

mkdir -p a/b/c

Guru.
2,077
Posted By methyl
Similarly. who -ms | awk '{print $1"@"$NF}' |...
Similarly.
who -ms | awk '{print $1"@"$NF}' | tr -d '()'



Note: In post #1 the first echo and the backticks were not needed or desirable.
2,077
Posted By balajesuri
echo -e "`whoami`\c"; echo -e "@\c"; who -ms |...
echo -e "`whoami`\c"; echo -e "@\c"; who -ms | cut -f 2 -d "(" | sed "s/)$//"

You could also do this:
who -ms | awk '{print $1"@"$NF}' | tr -d '()'
1,922
Posted By agama
Piping your ls output through this should work: ...
Piping your ls output through this should work:


awk '{n=split( $NF, a, "/" ); $NF=a[n]; print}'


The last field is split and n is assigned the number of fields. The last field is then...
1,614
Posted By rdcwayx
[ -d "/path/a valid/path" ] && echo "A...
[ -d "/path/a valid/path" ] && echo "A directory" || echo "Not a directory"
1,614
Posted By Peasant
You can use test to confirm that path exists and...
You can use test to confirm that path exists and is a directory.


test -d "/path/a valid/path" && printf "A directory \n" || printf "Not a directory \n"


Check man test for further test...
Showing results 1 to 6 of 6

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