Midhun 123
asked on
Is there anyway to provide space in between folder name (for moving files from one linux server to another) in shell script?
Hi Experts,
Good Day..
I have a shell script which moves files from one linux server to another.
As per the requirement , Output path folder contains space in between folder name ..eg ----outputserver/file out/date on file/.
According to my knowledge , If path contains space in between,command wont execute successfully.
Can anyone help on this how to proceed further..Is there anyway to give path with space like mentioned above.
Good Day..
I have a shell script which moves files from one linux server to another.
As per the requirement , Output path folder contains space in between folder name ..eg ----outputserver/file out/date on file/.
According to my knowledge , If path contains space in between,command wont execute successfully.
Can anyone help on this how to proceed further..Is there anyway to give path with space like mentioned above.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank You for all your help..
I have a question ..Inside Shell Script,I am using cd command.
for 'CD' Command also,Can we use doubel quotes?
I have a question ..Inside Shell Script,I am using cd command.
for 'CD' Command also,Can we use doubel quotes?
Yes, it possible to use spaces whatever you want, as far as any other special charater, just use "\" symbol before it.
so your path /home/user/My documents/file turn into: /home/user/My\ documents/file
or you could use quotes for entire path:
"/home/user/My documents/file"
so your path /home/user/My documents/file turn into: /home/user/My\ documents/file
or you could use quotes for entire path:
"/home/user/My documents/file"
Sure, in your case:
cd "outputserver/file out/date"
cd "outputserver/file out/date"
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No, it's not working that way, Dmitriy. An asker might prefer comments over others, but an Expert should not if posting a closing suggestion.
Are the first two comments correct? Yes, so they deserve points.
Your comment however is a reply for a follow-up question, not really adding more info (only confirming that it works for cd), and despite several Experts already contributed.
My suggestion is 250 points for each of
https:#a42603149
https:#a42603154
https:#a42603226
https:#a42603872
as this are replies to the original question, and noci provided useful explanations (so getting double points).
Are the first two comments correct? Yes, so they deserve points.
Your comment however is a reply for a follow-up question, not really adding more info (only confirming that it works for cd), and despite several Experts already contributed.
My suggestion is 250 points for each of
https:#a42603149
https:#a42603154
https:#a42603226
https:#a42603872
as this are replies to the original question, and noci provided useful explanations (so getting double points).
So type this:
outputserver/file[TAB]out
which will auto-complete to:
outputserver/file\ out
(\ is one of the 2 answers given above)