Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Escaping Forward Slash

Shell Programming and Scripting


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 2 Weeks Ago
alvinoo alvinoo is offline
Registered User
 
Join Date: Jun 2015
Last Activity: 16 October 2017, 10:29 AM EDT
Posts: 92
Thanks: 8
Thanked 1 Time in 1 Post
Escaping Forward Slash


Code:
./split2.sh: line 1: split/ssl/pop3s.txt: No such file or directory
sort: cannot read: split/ssl/pop3s.txt: No such file or directory

Hi there,

I am pulling data from the following source:

Code:
ssl/http
ssl/http
ssl/http-alt
ssl/https
ssl/https
ssl/https
ssl/https
ssl/https
ssl/https
ssl/ms-wbt-server
ssl/ms-wbt-server
ssl/pop3s


My Code I is taking from the list of data above. How can I escape it?

Code:
for i in `cat commontypes.txt`;do cat *.grep|grep "open.*$i"|cut -d " " -f 2 > "split/$i.txt" ;  sort -V "split/$i.txt" | sort -u ;done

Sponsored Links
    #2  
Old Unix and Linux 2 Weeks Ago
RavinderSingh13 RavinderSingh13 is online now Forum Advisor  
Registered User
 
Join Date: May 2013
Last Activity: 22 October 2017, 10:28 PM EDT
Location: Chennai
Posts: 2,638
Thanks: 580
Thanked 1,254 Times in 1,129 Posts
Quote:
Originally Posted by alvinoo View Post
Code:
./split2.sh: line 1: split/ssl/pop3s.txt: No such file or directory
sort: cannot read: split/ssl/pop3s.txt: No such file or directory

Hi there,
I am pulling data from the following source:

Code:
ssl/http
ssl/http
ssl/http-alt
ssl/https
ssl/https
ssl/https
ssl/https
ssl/https
ssl/https
ssl/ms-wbt-server
ssl/ms-wbt-server
ssl/pop3s

My Code I is taking from the list of data above. How can I escape it?

Code:
for i in `cat commontypes.txt`;do cat *.grep|grep "open.*$i"|cut -d " " -f 2 > "split/$i.txt" ;  sort -V "split/$i.txt" | sort -u ;done

Hello alvinoo,

It is obvious error there could be 2 reasons for this error.

1st: Either you should have mention /split in case /split is a mount point.
2nd: Or if your objective is to place files into current directory, where a directory named split is present. Then you have to make sure first directory split is present in current directory or make sure you have this directory present into your current directory.

Also your commands seems to be we could improve them in case you could let us know your complete objective like what you are trying to do with Input_file's data? Please do let us know more details with all conditions and samples(in code tags), so that we could help you more.

Thanks,
R. Singh
Sponsored Links
    #3  
Old Unix and Linux 2 Weeks Ago
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 22 October 2017, 5:17 PM EDT
Location: Aachen, Germany
Posts: 11,483
Thanks: 310
Thanked 3,561 Times in 3,276 Posts
What do you want to escape?
What is ./split2.sh: line 1:?
Does whatever your Code is work with the first eleven lines in your "source" (which I guess is called "commontypes.txt")?
How is line 12 different?

Last edited by RudiC; 1 Week Ago at 09:50 AM.. Reason: typo
    #4  
Old Unix and Linux 2 Weeks Ago
alvinoo alvinoo is offline
Registered User
 
Join Date: Jun 2015
Last Activity: 16 October 2017, 10:29 AM EDT
Posts: 92
Thanks: 8
Thanked 1 Time in 1 Post
Quote:
Originally Posted by RavinderSingh13 View Post
Hello alvinoo,

It is obvious error there could be 2 reasons for this error.

1st: Either you should have mention /split in case /split is a mount point.
2nd: Or if your objective is to place files into current directory, where a directory named split is present. Then you have to make sure first directory split is present in current directory or make sure you have this directory present into your current directory.

Also your commands seems to be we could improve them in case you could let us know your complete objective like what you are trying to do with Input_file's data? Please do let us know more details with all conditions and samples(in code tags), so that we could help you more.

Thanks,
R. Singh
Hi Ravinder,

Code:
Split

is in my current directory.
When I face situation like
Code:
ssl/http

it does not work whereas example like without
Code:
/

can work
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
AWK or SED to replace forward slash dshakey Shell Programming and Scripting 5 02-27-2012 10:29 PM
Using sed to append backward slash before forward slash sarbjit Shell Programming and Scripting 2 10-15-2009 04:30 AM
escaping / (forward slash) farooqpervaiz Shell Programming and Scripting 1 08-07-2008 02:26 AM
Help with SED and forward slash gseyforth Shell Programming and Scripting 3 05-26-2008 07:29 AM
grep for forward slash wxornot Shell Programming and Scripting 3 02-29-2008 09:01 PM



All times are GMT -4. The time now is 10:29 PM.