Here is my script.
#!/bin/sh
grep $ `date +%Y%m%d`/filename.txt | sed 1d
pretty simple. I am looking to be able to run the script with just a value after it, where the value should replace the "$", such as:
bash-4.1$ ./script.sh | "value"
Any ideas on how I can do this?
./script.sh | "value"will run your script with no arguments and send the standard output to a programvalue. You can use./script.sh "value"to passvalueas$1to the shell script (so you'd replace the$with$1). If you want to search for a pipe symbol followed by 'value', then you'd need./script.sh '| value'with the pipe inside quotes.