$ cat testfile | grep myloc | xargs sed 's/=/ /g' |awk '{print $2}' | bash
sed: can't read alias: No such file or directory
sed: can't read myloc=cd /export/nfs-1sv-23/: No such file or directory
Hi think grep myloc = grep cd export/nfs-1sv-23/ i think its wrong can u pls check it
it think should be grep "cd export/nfs-1sv-23/"
please can u be more specific like what are u try to to grep i mean are u trying to grep "some cd" or grep "somepath to file" commands from a file containing multiple
Here is what am planning / my need
We have a NFS mount point on each host - /export/nfs-1sv-23; this NFS mountpoint will be different on different hosts and like that I have 1500 hosts almost 100 NFS mount points are there connecting 1500 Hosts.
So we kept the alias in .profile [ our default shell is KSH ] so as soon as call myloc it will take me to /export/nfs-1sv-23. People who build those shells edited 1500 .profile files.. and kept the
But I want to Keep that same stuff in my .bashrc [ a single file that will be pushed to each host ] so its unique instead of me editing my .bashrc file ... i want to get that content from exisiting file and use it.
cat and grep needs to pass the output which needs to be excuted. Not sure how to acheive this
---------- Post updated at 11:01 PM ---------- Previous update was at 04:30 PM ----------