linux echo extra slash -


i creating script go into particular column , row in csv file , use data part of file subdirectory. so, have directory = $d , sub-directory = $s

my scripts works well, not important part. when try output information in script like..

echo "file $d/$s unable replicated" 

i output on screen...

file /home/jsigel//filename unable replicated 

what need rid of slash? i've tried thousand things , nothing seems work.

the slash harmless, can remove output if with

echo "file ${d%/}/$s unable replicated" 

if $d have trailing slash, removed , explicit / output in place. if $d not have trailing slash, no change made, , again explicit / output.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -