Search Results

Search: Posts Made By: gaurab
6,512
Posted By Corona688
Add exec /bin/bash to your ~/.tcshrc, tcsh will...
Add exec /bin/bash to your ~/.tcshrc, tcsh will load this file and cause it to run a bash shell on login.

If you ever really do need tcsh, you'll have to run tcsh -f to make it bypass these files.
2,515
Posted By drl
Hi. Making use of GNU standard utilities...
Hi.

Making use of GNU standard utilities join and sort, excluding headers:
join -1 2 -2 1 -o 1.1 0 2.2 <( sort -k2,2 $FILE1 ) <( sort -k1,1 $FILE2 )
producing:
x1 y2 z2
x5 y3 z3
x2 y4 z4
x3...
2,515
Posted By royalibrahim
awk 'NR==FNR {a[$1]=$2; next} $2 in a {print $0,...
awk 'NR==FNR {a[$1]=$2; next} $2 in a {print $0, a[$2]}' f2 f1

Please let me know if there is any more cute and compact solution.
2,515
Posted By acmvillareal
RE: Data file manipulation
Hope this helps :)
#!/bin/sh

INPUT_PATH="/home/"
INPUT_FILE1="${INPUT_PATH}sample2.file1.txt"
INPUT_FILE2="${INPUT_PATH}sample2.file2.txt"
OUTPUT_FILE="${INPUT_PATH}sample2.file.out"...
1,346
Posted By vbe
X="\$Y" Y="Z" eval U=$X; echo "X=...
X="\$Y"
Y="Z"
eval U=$X; echo "X= "$U
1,346
Posted By ctsgnb
# x=y # y=z # eval echo \$$x z or... ...
# x=y
# y=z
# eval echo \$$x
z

or...
# x=z
# echo $x
z

:D
5,867
Posted By LivinFree
This works in bash: echo ${PWD##*/} ...
This works in bash:

echo ${PWD##*/}


[Edit: Derp - I somehow missed everyone else's replies. Sorry for the repeat.]
5,867
Posted By Scott
It depends on your shell, but you could also try:...
It depends on your shell, but you could also try:


$ echo ${PWD##*/}
HERE
5,867
Posted By Corona688
basename "$PWD"
basename "$PWD"
Showing results 1 to 9 of 9

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