Hi everyone Gurus, I have question I wanna see excute command again
e.g.
$ pwd; hostname
but one line
$ /home/user myhostname
Hi everyone Gurus, I have question I wanna see excute command again
e.g.
$ pwd; hostname
but one line
$ /home/user myhostname
Hi, try:
{ pwd; hostname; } | paste - -
echo "$(pwd) $(hostname)"
pwd | tr '\n' '\t' ; hostname
many ways to skin that "cat":
printf "%s %s\n", "$(pwd)" "$(hostname)"
(pwd; hostname) | sed '$!N;s/\n/ /'
Hi
echo $PWD $HOSTNAME
you can just insert two variables where you need
"$PWD $HOSTNAME"
And if you are using KSH:
echo $(pwd;hostname)
It works in bash also
Note: The approaches with unquoted command and parameter expansions are subject to field splitting by the shell and may not render correct results, for example in the case of paths with spaces in them, with IFS
set to its default value.
Note2: The variables PWD
and HOSTNAME
may not always be available or set reliably.
Thank a lot gurus
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.