Hello sir,
when ever we log into the terminal.
By default we go into "\root" as the pwd.
I save my shell scripts in a location in the root for which I need to do "cd <dir name>" multiple no.of times to go there.
So I am writing a code that will bookmark the location so that when I hit that command, then I can directly go to that location.
I am the root user.The code that I wrote is :-
Quote:
#!/bin/bash
echo "enter name of this BOOKMARK:"
read name
location=`pwd`
echo "#!/bin/bash" |cat > /usr/bin/$name
echo "cd $location" |cat >> /usr/bin/$name
chmod 777 /usr/bin/$name
If u execute it, I have no errors.The bookmark is created but still I am staying in the current location itself.Please execute this shell once in any location of your file system.We are trying to BOOKMARK it with a name which will be the future reference of that location instead of using "cd" multiple times.....
can u please tell me whats going wrong ??