Re: Display cmd within shell

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2018-06-11 at 08:40 -0400, bruce wrote:
> Hi.
> 
> Running a centos/fed box, and trying to craft a simple shell test to
> run a bunch of commands where the command is displayed as well as the
> output
> 
> Ie. The following cmd might return 10 (the num of the files if the cmd
> is run from the cmdline.
> 
> ls -al /cloud_nfs_parse/austincc*__parse.dat | wc -l
> 10
> 
> However I can't seem to figure out how to run the cmd from within a
> shell script where I can display the "cmd" as well as the result.
> 
> #!/bin/sh
> 
> ##
> #cp.sh
> #
> # run as a test from the nfs /cloud_nfs_parse to gen the num of parse.dat files
> #    from the bn crawl
> #
> #
> 
> #-- this doesn't quite work.. as it generates the complete "ls...
> output" but it does display the cmd and the resulting num of the ls
> files..
> (set -x; ls -al /cloud_nfs_parse/austincc*__parse.dat | wc -l )
> exit
> 
> 
> Thoughts/comments??

Showing the expected versus actual output would be a start.

Maybe also consider 'expect' (dnf info expect), though that might be
overkill.

poc
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx/message/2LXPCEDNEBOPZJN5QUZ4EOEDALMYPI6P/



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux