New answers tagged

1

What you wrote in this line: tempFile=`cut -c1 $1` does not create a file called tempFile. Therefore you can not read from it. You may change that line to: cut -c1 "$1" > tempFile And a file called tempFile will be created for the while read loop to read. Do not use $tempFile in that loop, as the variable $tempfile is null (does not exist). Use ...


1

Try enclosing the commands into parentheses for i in $(ls -ltr | grep ' Nov' | awk '{print $NF}') do for j in $(unzip -l $i | grep -i SystemOut | awk '{print $NF}') do unzip -c $i | grep -i Live | grep 'smarter planet' done done


2

It seems that cryptsetup requires the LUKS header to be either regular file or device. If you need to provide the LUKS header as an output from a process/stream, you can easily circumvent the restriction by sending it to /dev/ram cat LUKS-HEADER > /dev/ram0 (provided that your kernel supports ramdisk) Then you can then simply use your cryptsetup ...


1

From what I could understand from your question, you just want to get the lines 2 and 3 from every file and output it into a new file. Here is a script to do so: find . -name "*.doc" | xargs awk 'FNR==2||FNR==3{print}' > new_file xargs will make awk process every file output by find. awk will print lines 2 and 3 from every new file it is supplied. In ...



Top 50 recent answers are included