Thanks for passing by, I'm having troubles creating functions directly in the shell. I am following a tutorial where it explains how to make a function to prepend environment variables. It shows how to mae the script:
Code: Select all
root@Zion:~# prepend() { [ -d "$2" ] && eval $1=\"$2':'\$$1\" && export $1; }
In the tutorial, obviously, worked fine, but when I declare the function, a new line appears, specting to write something else. Like if I haven't finish, and the only way to get out of it is pressing crtl+c, but, obviously, the function is not declare at all.
Code: Select all
root@Zion:~# prepend() { [ -d "$2" ] && eval $1=\"$2':'\$$1\" && export $1; }
>
>
root@Zion:~# prepend LD_LIBRARY_PATH /my/path
-bash: prepend: no se encontró la orden