Sponsored Content
Top Forums Shell Programming and Scripting Script template for inputting filenames and print results Post 302499558 by radoulov on Thursday 24th of February 2011 04:17:55 PM
Old 02-24-2011
Code:
#!/bin/bash

(( $# < 1 )) && {
  printf "usage: %s <file_name>\n" "${0##*/}"
  exit 1
  }

_server_list=(
  server1
  server2
  )
  
_fn=$1

_cmd=/usr/bin/md5sum

for s in "${_server_list[@]}"; do
  ssh "$s" "
    [ -f "$_fn" ] && 
      $_cmd $_fn" ||
        printf "error executing %s %s on %s\n" \
          "$_cmd" "$_fn" "$s"
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search file and print results with shell script

input file 1.<CRMSUB:MSIN=0100004735,BSNBC=TELEPHON-9814060328-TS11&TS21&TS22,NDC=9814,MSCAT=ORDINSUB,SUBRES=ALLPLMN-SPICE,BAOC=OIC,BAPRC=INFO,ACCSUB=BSS,NUMTYP=MULTI;... (3 Replies)
Discussion started by: dodasajan
3 Replies

2. Shell Programming and Scripting

Print filenames with spaces using awk

Hello all, I want to list the file contents of the directory and number them. I am using la and awk to do it now, #ls |awk '{print NR "." $1}' 1. alpha 2. beta 3. gamma The problem I have is that some files might also have some spaces in the filenames. #ls alpha beta gamma ... (7 Replies)
Discussion started by: grajp002
7 Replies

3. Shell Programming and Scripting

Print just 1 results from the whole line

Hi All, need some help with writing a shell script. I tried to search this forum but couldn't find exactly what i want. If you all know any reference link i can read and refer to solve my issue, let me know. I got 1 file i.e: example.txt. It is content list of data, as below example. What... (2 Replies)
Discussion started by: anakiar
2 Replies

4. Shell Programming and Scripting

How to print the last column of the list contain filenames with spaces.

Hi experts, I have the following data: I want the last filed in the output. How to print the last field , It contains the file names and few filenames with white spaces . -rw-r--r-- 1 root root 0 2010-04-26 16:57 file1 2space_File.txt -rw-r--r-- 1 root root 0 2010-04-26... (2 Replies)
Discussion started by: rveri
2 Replies

5. Shell Programming and Scripting

print first few lines, then apply regex on a specific column to print results.

abc.dat tty cpu tin tout us sy wt id 0 0 7 3 19 71 extended device statistics r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device 0.0 133.2 0.0 682.9 0.0 1.0 0.0 7.2 0 79 c1t0d0 0.2 180.4 0.1 5471.2 3.0 2.8 16.4 15.6 15 52 aaaaaa1-xx I want to skip first 5 line... (4 Replies)
Discussion started by: kchinnam
4 Replies

6. Shell Programming and Scripting

Print some results in a text file using script in linux

hello everyone, i really need your help to write a script which would just print following kind of result into a text file (result.txt) XYZ test Results ID: <unique-id> Date: <date> ------------------------------------------------- | Task | Result | Time |... (3 Replies)
Discussion started by: viriimind
3 Replies

7. Shell Programming and Scripting

[awk] print all filenames in directory

Hello, I was given a (I suppose) a simple task which I don't know how to do. Before coming here I have read a dozen of awk tutorials (full read, not just line-skipping) but I still don't know how to do this. Task: Write an script file 'check.awk' with a parameter current directory that... (5 Replies)
Discussion started by: c0dehunter
5 Replies

8. Shell Programming and Scripting

Print and Append the matching filenames

Hi, I want to check all files in a folder for some specific start string and append all matching filenames with _1, _2 .... for each file found in the directory. But, $file below gives me all details of the files like access permissions, owner and filename etc. I just want all the filenames... (3 Replies)
Discussion started by: chetancrsp18
3 Replies

9. Shell Programming and Scripting

how to print off results

print from an ip_list file containing 300 ip's the directory of the results is /var/tmp/1.1.1.1 the 1.1.1.1 will change according to the /tmp/ip_list file i.e 1.1.1.1 2.2.2.2 3.3.3.3 I need the results from /var/tmp/1.1.1.1 once done the script goes to the next ip address in... (11 Replies)
Discussion started by: slashbash
11 Replies

10. Shell Programming and Scripting

print all filenames in directory with path to another file

hi, i have a directory at /path/unix with the following files 1.txt 2.txt 3.txt 4.txt I want to make another file called filenames.txt at a different location called /path/home. So, my output file would be /path/home/filenames.txt with contents /path/unix/1.txt... (1 Reply)
Discussion started by: jacobs.smith
1 Replies
gst-md5sum-0.8(1)						   User Commands						 gst-md5sum-0.8(1)

NAME
gst-md5sum-0.8, gst-md5sum - get an md5sum of a GStreamer pipeline through md5sink SYNOPSIS
gst-md5sum-0.8 [--verbose] [gst-std-options] [partial-pipeline-description] gst-md5sum [--verbose] [gst-std-options] [partial-pipeline-description] [--gst-list-mm] [--gst-mm=string] [--print] DESCRIPTION
gst-md5sum-0.8 generates MD5 checksums of the data generated by a GStreamer pipeline. In theory, both of the following commands should print out the same checksum: gst-md5sum-0.8 filesrc location=music.mp3 md5sum music.mp3 If the pipeline contains an md5sink element, gst-md5sum-0.8 queries it for the md5sum at the end of pipeline iteration. If the pipeline does not contain an md5sink element, gst-md5sum-0.8 automatically connects an md5sink to the right-hand side of the given pipeline. See gst-launch(1) or the GStreamer documentation for more information on how to create a partial-pipeline-description. gst-md5sum is a wrapper script that runs the latest installed version of gst-md5sum-X.X. For example, if both gst-md5sum-0.7 and gst- md5sum-0.8 are installed on your system, gst-md5sum runs gst-md5sum-0.8. OPTIONS
The following options are supported by gst-md5sum-0.8 and gst-md5sum: --verbose Output verbose information. You can also use -v to specify this option. gst-std-options Standard options available for use with most GStreamer applications. See gst-std-options(5) for more information. The following options are supported by gst-md5sum only: --gst-list-mm List found major/minor versions. This option displays the versions that are available. --gst-mm=string Force major/minor version. This option enables you to specify a specific version to run, if you do not want to run the default version. --print Print wrapped command line. This option displays the command that will be run, and then runs the command. OPERANDS
The following operands are supported: partial-pipelinePartialppipeline description. EXAMPLES
Example 1: Running the Wrapper Script and Displaying the Command Name example% gst-md5sum --print /usr/bin/gst-md5sum-0.8 FILES
The following files are used by this application: /usr/bin/gst-md5sum-0.8 Executable for GNOME help browser /usr/bin/gst-md5sum Wrapper script that runs the latest installed version of gst-md5sum-X.X ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-media | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
gst-complete(1), gst-compprep(1), gst-feedback(1), gst-inspect(1), gst-launch(1), gst-launch-ext(1), gst-register(1), gst-thumbnail(1), gst-typefind(1), gst-xmlinspect(1), gst-xmllaunch(1), gstreamer-properties(1), libgstreamer-0.8(3), libgstgetbits(3), gst-std-options(5) NOTES
Original man page written by the GStreamer team at http://gstreamer.net/. Updated by Brian Cameron, Sun Microsystems Inc., 2004. SunOS 5.10 14 Oct 2004 gst-md5sum-0.8(1)
All times are GMT -4. The time now is 01:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy