Directory tree listing, script does not work in csh?

Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
0
down vote
favorite
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^/]*//--/g' -e 's/^/ /' -e 's/-/|/'
I found a command to display directory tree (see above), it didn't work correctly. It gave error message "Illegal variable name". I think the error is at $ sign. How can I modify this command for cshell environment?
variable csh tree
add a comment |Â
up vote
0
down vote
favorite
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^/]*//--/g' -e 's/^/ /' -e 's/-/|/'
I found a command to display directory tree (see above), it didn't work correctly. It gave error message "Illegal variable name". I think the error is at $ sign. How can I modify this command for cshell environment?
variable csh tree
1
Other than escaping it?
â Ignacio Vazquez-Abrams
Jul 30 at 8:04
1
I suspect that I am not the only one enjoying that the answer is given only a few characters further along in the question itself.
â JdeBP
Jul 30 at 8:38
What is âÂÂdirectory commandâÂÂ?
â ctrl-alt-delor
Jul 30 at 9:08
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^/]*//--/g' -e 's/^/ /' -e 's/-/|/'
I found a command to display directory tree (see above), it didn't work correctly. It gave error message "Illegal variable name". I think the error is at $ sign. How can I modify this command for cshell environment?
variable csh tree
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^/]*//--/g' -e 's/^/ /' -e 's/-/|/'
I found a command to display directory tree (see above), it didn't work correctly. It gave error message "Illegal variable name". I think the error is at $ sign. How can I modify this command for cshell environment?
variable csh tree
edited Jul 30 at 17:58
Jeff Schaller
30.7k846104
30.7k846104
asked Jul 30 at 8:01
Trong Nhan Nguyen
172
172
1
Other than escaping it?
â Ignacio Vazquez-Abrams
Jul 30 at 8:04
1
I suspect that I am not the only one enjoying that the answer is given only a few characters further along in the question itself.
â JdeBP
Jul 30 at 8:38
What is âÂÂdirectory commandâÂÂ?
â ctrl-alt-delor
Jul 30 at 9:08
add a comment |Â
1
Other than escaping it?
â Ignacio Vazquez-Abrams
Jul 30 at 8:04
1
I suspect that I am not the only one enjoying that the answer is given only a few characters further along in the question itself.
â JdeBP
Jul 30 at 8:38
What is âÂÂdirectory commandâÂÂ?
â ctrl-alt-delor
Jul 30 at 9:08
1
1
Other than escaping it?
â Ignacio Vazquez-Abrams
Jul 30 at 8:04
Other than escaping it?
â Ignacio Vazquez-Abrams
Jul 30 at 8:04
1
1
I suspect that I am not the only one enjoying that the answer is given only a few characters further along in the question itself.
â JdeBP
Jul 30 at 8:38
I suspect that I am not the only one enjoying that the answer is given only a few characters further along in the question itself.
â JdeBP
Jul 30 at 8:38
What is âÂÂdirectory commandâÂÂ?
â ctrl-alt-delor
Jul 30 at 9:08
What is âÂÂdirectory commandâÂÂ?
â ctrl-alt-delor
Jul 30 at 9:08
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
:$ should be in single quotes to stop the shell from expanding it.
so ls -R | grep ':$' | sed -e 's/:$//' -e 's/[^-][^/]*//--/g' -e 's/^/ /' -e 's/-/|/'
Your next thing to learn, is shell quoting, and expansions.
Also a lot of people consider csh to have been a mistake. It is full of odd inconsistent behaviour. Consider another bash, ksh, fish â¦
add a comment |Â
up vote
1
down vote
Instead of a shell script you can use an external commands. 'tree' may be available in your environment, then it's easy.
tree -d
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
:$ should be in single quotes to stop the shell from expanding it.
so ls -R | grep ':$' | sed -e 's/:$//' -e 's/[^-][^/]*//--/g' -e 's/^/ /' -e 's/-/|/'
Your next thing to learn, is shell quoting, and expansions.
Also a lot of people consider csh to have been a mistake. It is full of odd inconsistent behaviour. Consider another bash, ksh, fish â¦
add a comment |Â
up vote
1
down vote
:$ should be in single quotes to stop the shell from expanding it.
so ls -R | grep ':$' | sed -e 's/:$//' -e 's/[^-][^/]*//--/g' -e 's/^/ /' -e 's/-/|/'
Your next thing to learn, is shell quoting, and expansions.
Also a lot of people consider csh to have been a mistake. It is full of odd inconsistent behaviour. Consider another bash, ksh, fish â¦
add a comment |Â
up vote
1
down vote
up vote
1
down vote
:$ should be in single quotes to stop the shell from expanding it.
so ls -R | grep ':$' | sed -e 's/:$//' -e 's/[^-][^/]*//--/g' -e 's/^/ /' -e 's/-/|/'
Your next thing to learn, is shell quoting, and expansions.
Also a lot of people consider csh to have been a mistake. It is full of odd inconsistent behaviour. Consider another bash, ksh, fish â¦
:$ should be in single quotes to stop the shell from expanding it.
so ls -R | grep ':$' | sed -e 's/:$//' -e 's/[^-][^/]*//--/g' -e 's/^/ /' -e 's/-/|/'
Your next thing to learn, is shell quoting, and expansions.
Also a lot of people consider csh to have been a mistake. It is full of odd inconsistent behaviour. Consider another bash, ksh, fish â¦
answered Jul 30 at 9:12
ctrl-alt-delor
8,54031946
8,54031946
add a comment |Â
add a comment |Â
up vote
1
down vote
Instead of a shell script you can use an external commands. 'tree' may be available in your environment, then it's easy.
tree -d
add a comment |Â
up vote
1
down vote
Instead of a shell script you can use an external commands. 'tree' may be available in your environment, then it's easy.
tree -d
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Instead of a shell script you can use an external commands. 'tree' may be available in your environment, then it's easy.
tree -d
Instead of a shell script you can use an external commands. 'tree' may be available in your environment, then it's easy.
tree -d
edited Jul 30 at 9:20
ctrl-alt-delor
8,54031946
8,54031946
answered Jul 30 at 9:17
redseven
1876
1876
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f459277%2fdirectory-tree-listing-script-does-not-work-in-csh%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Other than escaping it?
â Ignacio Vazquez-Abrams
Jul 30 at 8:04
1
I suspect that I am not the only one enjoying that the answer is given only a few characters further along in the question itself.
â JdeBP
Jul 30 at 8:38
What is âÂÂdirectory commandâÂÂ?
â ctrl-alt-delor
Jul 30 at 9:08