Sorry for not making myself clear:
The actual names of the directories are:
"File Reader (#53)"
"CSV Writer (#47)"
"Scorer (#22)"
but to just make it simple we can rename them to:
"dir1 (#29)"
"dir2 (#45)"
"dir3 (#23)"
I have gathered all of the directory names using the following code:
dirs=`ls -d *(#*`
echo $dirs
output:
"dir1 (#29)"
"dir2 (#45)"
"dir3 (#23)"
Now I would like use SED to return the number portion of the desired directory name. For example, I would like to be able to input the string "dir1". Using the list of directories that I have already generated and stored into variable $dirs I want the output to be 29. Preferably if this value could be stored in a variable also would be great. Alternatively, if I was looking for "dir2" from the list of dirs, the desired output would be 45. Likewise for "dir3" where the desired output would be 23.
The number is part of the directory's name. All I am trying to do is cut the desired directory name and only return the number portion.
this did not work and returned the following message:
sed: can't read fileread.txt: No such file or directory
I am not sure why it is looking for an input file. No input file is needed.