apologies for this simple question....i have several books here that say this should work, and it doesnt....
i have HP-UX11.0 and my default shell is /sbin/sh
i tried to write a long script and run it and it didnt work, so i backed up and started with this simple script and it doesnt work either.
my test script, named [test], is
#!/sbin/sh
goto="cd /home/dleo/9hair"
export goto
echo $goto
echo "youre done"
# end of script
i set chmod for [test] to execute permission and ran it by typing ./test and it appeared to run correctly seen by the echoes to the screen
but when i type in $goto after the $ prompt and then check my pwd, it is not /home/dleo/9hair ....i am still in the directory i was in.
however.... when i type in goto="cd /home/dleo/9hair" at the command line and then type in $goto ....that correctly takes me to /home/dleo/9hair.
this is exactly what i experienced with the longer script file....it seemed to run but didnt really.
my books say this should work.
any help would be appreciated .... i have noone who knows unix.
daveleo
i have HP-UX11.0 and my default shell is /sbin/sh
i tried to write a long script and run it and it didnt work, so i backed up and started with this simple script and it doesnt work either.
my test script, named [test], is
#!/sbin/sh
goto="cd /home/dleo/9hair"
export goto
echo $goto
echo "youre done"
# end of script
i set chmod for [test] to execute permission and ran it by typing ./test and it appeared to run correctly seen by the echoes to the screen
but when i type in $goto after the $ prompt and then check my pwd, it is not /home/dleo/9hair ....i am still in the directory i was in.
however.... when i type in goto="cd /home/dleo/9hair" at the command line and then type in $goto ....that correctly takes me to /home/dleo/9hair.
this is exactly what i experienced with the longer script file....it seemed to run but didnt really.
my books say this should work.
any help would be appreciated .... i have noone who knows unix.
daveleo